mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-28 14:49:50 +02:00
2019-08-26 Fred Gleason <fredg@paravelsystems.com>
* Reimplemented the '--asoundrc-file=' directive in rdalsaconfig(8).
This commit is contained in:
parent
4f9b800379
commit
7fe3952c5d
@ -18956,3 +18956,6 @@
|
||||
2019-08-26 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a bug in rdalsaconfig(8) that caused a 'Service not
|
||||
active' error to be generated at startup.
|
||||
2019-08-26 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Reimplemented the '--asoundrc-file=' directive in
|
||||
rdalsaconfig(8).
|
||||
|
@ -136,7 +136,7 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
//
|
||||
alsa_system_model=new RDAlsaModel(rda->system()->sampleRate(),this);
|
||||
alsa_system_list->setModel(alsa_system_model);
|
||||
LoadConfig();
|
||||
LoadConfig(alsa_filename);
|
||||
|
||||
//
|
||||
// Daemon Management
|
||||
@ -199,7 +199,7 @@ void MainWidget::saveData()
|
||||
StartDaemons();
|
||||
*/
|
||||
|
||||
SaveConfig();
|
||||
SaveConfig(alsa_filename);
|
||||
|
||||
qApp->quit();
|
||||
}
|
||||
@ -246,7 +246,7 @@ void MainWidget::closeEvent(QCloseEvent *e)
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::LoadConfig()
|
||||
void MainWidget::LoadConfig(const QString &filename)
|
||||
{
|
||||
FILE *f=NULL;
|
||||
char line[1024];
|
||||
@ -258,7 +258,7 @@ void MainWidget::LoadConfig()
|
||||
bool active_line=false;
|
||||
QModelIndex index;
|
||||
|
||||
if((f=fopen(RD_ASOUNDRC_FILE,"r"))==NULL) {
|
||||
if((f=fopen(filename.toUtf8(),"r"))==NULL) {
|
||||
return;
|
||||
}
|
||||
while(fgets(line,1024,f)!=NULL) {
|
||||
@ -330,9 +330,9 @@ void MainWidget::LoadConfig()
|
||||
}
|
||||
|
||||
|
||||
void MainWidget::SaveConfig() const
|
||||
void MainWidget::SaveConfig(const QString &filename) const
|
||||
{
|
||||
QString tempfile=QString(RD_ASOUNDRC_FILE)+"-temp";
|
||||
QString tempfile=filename+"-temp";
|
||||
FILE *f=NULL;
|
||||
|
||||
if((f=fopen(tempfile.toUtf8(),"w"))==NULL) {
|
||||
@ -363,7 +363,7 @@ void MainWidget::SaveConfig() const
|
||||
fprintf(f,"%s\n",END_MARKER);
|
||||
|
||||
fclose(f);
|
||||
rename(tempfile.toUtf8(),RD_ASOUNDRC_FILE);
|
||||
rename(tempfile.toUtf8(),filename.toUtf8());
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,8 +53,8 @@ class MainWidget : public QWidget
|
||||
void closeEvent(QCloseEvent *e);
|
||||
|
||||
private:
|
||||
void LoadConfig();
|
||||
void SaveConfig() const;
|
||||
void LoadConfig(const QString &filename);
|
||||
void SaveConfig(const QString &filename) const;
|
||||
QLabel *alsa_system_label;
|
||||
QLabel *alsa_description_label;
|
||||
QListView *alsa_system_list;
|
||||
|
Loading…
x
Reference in New Issue
Block a user