modernize: Reformat ALL the source... again!
[quassel.git] / src / qtui / settingspagedlg.cpp
index 48a660b..6863c11 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "icon.h"
 
-SettingsPageDlg::SettingsPageDlg(SettingsPage *page, QWidget *parent)
+SettingsPageDlg::SettingsPageDlg(SettingsPage* page, QWidget* parent)
     : QDialog(parent)
 {
     ui.setupUi(this);
@@ -51,30 +51,29 @@ SettingsPageDlg::SettingsPageDlg(SettingsPage *page, QWidget *parent)
     setButtonStates();
 }
 
-
-SettingsPage *SettingsPageDlg::currentPage() const
+SettingsPage* SettingsPageDlg::currentPage() const
 {
     return _currentPage;
 }
 
-
 void SettingsPageDlg::setButtonStates()
 {
-    SettingsPage *sp = currentPage();
+    SettingsPagesp = currentPage();
     ui.buttonBox->button(QDialogButtonBox::Apply)->setEnabled(sp && sp->hasChanged());
     ui.buttonBox->button(QDialogButtonBox::Reset)->setEnabled(sp && sp->hasChanged());
     ui.buttonBox->button(QDialogButtonBox::RestoreDefaults)->setEnabled(sp && sp->hasDefaults());
 }
 
-
-void SettingsPageDlg::buttonClicked(QAbstractButton *button)
+void SettingsPageDlg::buttonClicked(QAbstractButton* button)
 {
     switch (ui.buttonBox->standardButton(button)) {
     case QDialogButtonBox::Ok:
         if (currentPage() && currentPage()->hasChanged()) {
-            if (applyChanges()) accept();
+            if (applyChanges())
+                accept();
         }
-        else accept();
+        else
+            accept();
         break;
     case QDialogButtonBox::Apply:
         applyChanges();
@@ -94,10 +93,10 @@ void SettingsPageDlg::buttonClicked(QAbstractButton *button)
     }
 }
 
-
 bool SettingsPageDlg::applyChanges()
 {
-    if (!currentPage()) return false;
+    if (!currentPage())
+        return false;
     if (currentPage()->aboutToSave()) {
         currentPage()->save();
         return true;
@@ -105,7 +104,6 @@ bool SettingsPageDlg::applyChanges()
     return false;
 }
 
-
 void SettingsPageDlg::undoChanges()
 {
     if (currentPage()) {
@@ -113,23 +111,29 @@ void SettingsPageDlg::undoChanges()
     }
 }
 
-
 void SettingsPageDlg::reload()
 {
-    if (!currentPage()) return;
-    int ret = QMessageBox::question(this, tr("Reload Settings"), tr("Do you like to reload the settings, undoing your changes on this page?"),
-        QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
+    if (!currentPage())
+        return;
+    int ret = QMessageBox::question(this,
+                                    tr("Reload Settings"),
+                                    tr("Do you like to reload the settings, undoing your changes on this page?"),
+                                    QMessageBox::Yes | QMessageBox::No,
+                                    QMessageBox::No);
     if (ret == QMessageBox::Yes) {
         currentPage()->load();
     }
 }
 
-
 void SettingsPageDlg::loadDefaults()
 {
-    if (!currentPage()) return;
-    int ret = QMessageBox::question(this, tr("Restore Defaults"), tr("Do you like to restore the default values for this page?"),
-        QMessageBox::RestoreDefaults|QMessageBox::Cancel, QMessageBox::Cancel);
+    if (!currentPage())
+        return;
+    int ret = QMessageBox::question(this,
+                                    tr("Restore Defaults"),
+                                    tr("Do you like to restore the default values for this page?"),
+                                    QMessageBox::RestoreDefaults | QMessageBox::Cancel,
+                                    QMessageBox::Cancel);
     if (ret == QMessageBox::RestoreDefaults) {
         currentPage()->defaults();
     }