From: Manuel Nickschas Date: Sun, 10 Feb 2008 13:44:07 +0000 (+0000) Subject: Prevent the settings dialogs from crashing when OK is pressed without changes made. X-Git-Tag: 0.2.0-alpha1~84 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=569bfa97ac24d59a77c1debf92fce356c2dc5826;hp=ba9d9d766830eab8cc238c60a69f67c8b527aa7e Prevent the settings dialogs from crashing when OK is pressed without changes made. --- diff --git a/src/qtui/settingsdlg.cpp b/src/qtui/settingsdlg.cpp index b02e7117..b5fc125c 100644 --- a/src/qtui/settingsdlg.cpp +++ b/src/qtui/settingsdlg.cpp @@ -121,7 +121,9 @@ void SettingsDlg::setButtonStates() { void SettingsDlg::buttonClicked(QAbstractButton *button) { switch(ui.buttonBox->standardButton(button)) { case QDialogButtonBox::Ok: - if(applyChanges()) accept(); + if(currentPage() && currentPage()->hasChanged()) { + if(applyChanges()) accept(); + } else accept(); break; case QDialogButtonBox::Apply: applyChanges(); diff --git a/src/qtui/settingspagedlg.cpp b/src/qtui/settingspagedlg.cpp index df37ba01..2c817a96 100644 --- a/src/qtui/settingspagedlg.cpp +++ b/src/qtui/settingspagedlg.cpp @@ -52,7 +52,9 @@ void SettingsPageDlg::setButtonStates() { void SettingsPageDlg::buttonClicked(QAbstractButton *button) { switch(ui.buttonBox->standardButton(button)) { case QDialogButtonBox::Ok: - if(applyChanges()) accept(); + if(currentPage() && currentPage()->hasChanged()) { + if(applyChanges()) accept(); + } else accept(); break; case QDialogButtonBox::Apply: applyChanges();