Prevent the settings dialogs from crashing when OK is pressed without changes made.
[quassel.git] / src / qtui / settingspagedlg.cpp
index df37ba0..2c817a9 100644 (file)
@@ -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();