提交 d49e4687 编写于 作者: A Arnaud Lacombe 提交者: 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: NHiromu Yakura <hiromu1996@gmail.com>
Pointed-out-by: NMichal Marek <mmarek@suse.cz>
Signed-off-by: NMichal Marek <mmarek@suse.cz>
上级 bdebd489
......@@ -1489,8 +1489,7 @@ void ConfigMainWindow::saveConfigAs(void)
QString s = Q3FileDialog::getSaveFileName(conf_get_configname(), NULL, this);
if (s.isNull())
return;
if (conf_write(QFile::encodeName(s)))
QMessageBox::information(this, "qconf", _("Unable to save configuration!"));
saveConfig();
}
void ConfigMainWindow::searchConfig(void)
......@@ -1643,7 +1642,7 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e)
mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit"));
switch (mb.exec()) {
case QMessageBox::Yes:
conf_write(NULL);
saveConfig();
case QMessageBox::No:
e->accept();
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册