Commit d49e4687 authored by Arnaud Lacombe's avatar Arnaud Lacombe Committed by Michal Marek

xconfig: merge code path to conf_write()

Avoid to have multiple path saving the config. This fixes an error check
miss when the window is being closed and the user requested the config
to be written.
Reported-by: default avatarHiromu Yakura <hiromu1996@gmail.com>
Pointed-out-by: default avatarMichal Marek <mmarek@suse.cz>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent bdebd489
...@@ -1489,8 +1489,7 @@ void ConfigMainWindow::saveConfigAs(void) ...@@ -1489,8 +1489,7 @@ void ConfigMainWindow::saveConfigAs(void)
QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this); QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this);
if (s.isNull()) if (s.isNull())
return; return;
if (conf_write(QFile::encodeName(s))) saveConfig();
QMessageBox::information(this, "qconf", _("Unable to save configuration!"));
} }
void ConfigMainWindow::searchConfig(void) void ConfigMainWindow::searchConfig(void)
...@@ -1643,7 +1642,7 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e) ...@@ -1643,7 +1642,7 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e)
mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit")); mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit"));
switch (mb.exec()) { switch (mb.exec()) {
case QMessageBox::Yes: case QMessageBox::Yes:
conf_write(NULL); saveConfig();
case QMessageBox::No: case QMessageBox::No:
e->accept(); e->accept();
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment