]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/settings/dolphinsettingsdialog.cpp
Merge branch 'master' into frameworks
[dolphin.git] / src / settings / dolphinsettingsdialog.cpp
index 17c25a057828cfb9171e451e25d47c825c1ea934..8c20a91489161266916763a3e5b3912b3c4e2cf0 100644 (file)
@@ -53,47 +53,51 @@ DolphinSettingsDialog::DolphinSettingsDialog(const KUrl& url, QWidget* parent) :
     box->button(QDialogButtonBox::Ok)->setDefault(true);
     setButtonBox(box);
 
+    connect(box->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
+    connect(box->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, this, &DolphinSettingsDialog::applySettings);
+    connect(box->button(QDialogButtonBox::RestoreDefaults), &QAbstractButton::clicked, this, &DolphinSettingsDialog::restoreDefaults);
+
     // Startup
     StartupSettingsPage* startupSettingsPage = new StartupSettingsPage(url, this);
     KPageWidgetItem* startupSettingsFrame = addPage(startupSettingsPage,
                                                     i18nc("@title:group", "Startup"));
     startupSettingsFrame->setIcon(KIcon("go-home"));
-    connect(startupSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+    connect(startupSettingsPage, &StartupSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
 
     // View Modes
     ViewSettingsPage* viewSettingsPage = new ViewSettingsPage(this);
     KPageWidgetItem* viewSettingsFrame = addPage(viewSettingsPage,
                                                  i18nc("@title:group", "View Modes"));
     viewSettingsFrame->setIcon(KIcon("view-choose"));
-    connect(viewSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+    connect(viewSettingsPage, &ViewSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
 
     // Navigation
     NavigationSettingsPage* navigationSettingsPage = new NavigationSettingsPage(this);
     KPageWidgetItem* navigationSettingsFrame = addPage(navigationSettingsPage,
                                                        i18nc("@title:group", "Navigation"));
     navigationSettingsFrame->setIcon(KIcon("input-mouse"));
-    connect(navigationSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+    connect(navigationSettingsPage, &NavigationSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
 
     // Services
     ServicesSettingsPage* servicesSettingsPage = new ServicesSettingsPage(this);
     KPageWidgetItem* servicesSettingsFrame = addPage(servicesSettingsPage,
                                                        i18nc("@title:group", "Services"));
     servicesSettingsFrame->setIcon(KIcon("services"));
-    connect(servicesSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+    connect(servicesSettingsPage, &ServicesSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
 
     // Trash
     TrashSettingsPage* trashSettingsPage = new TrashSettingsPage(this);
     KPageWidgetItem* trashSettingsFrame = addPage(trashSettingsPage,
                                                    i18nc("@title:group", "Trash"));
     trashSettingsFrame->setIcon(KIcon("user-trash"));
-    connect(trashSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+    connect(trashSettingsPage, &TrashSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
 
     // General
     GeneralSettingsPage* generalSettingsPage = new GeneralSettingsPage(url, this);
     KPageWidgetItem* generalSettingsFrame = addPage(generalSettingsPage,
                                                     i18nc("@title:group General settings", "General"));
     generalSettingsFrame->setIcon(KIcon("system-run"));
-    connect(generalSettingsPage, SIGNAL(changed()), this, SLOT(enableApply()));
+    connect(generalSettingsPage, &GeneralSettingsPage::changed, this, &DolphinSettingsDialog::enableApply);
 
     const KConfigGroup dialogConfig(KSharedConfig::openConfig("dolphinrc"), "SettingsDialog");
 #pragma message("TODO: port")
@@ -114,18 +118,6 @@ DolphinSettingsDialog::~DolphinSettingsDialog()
     //saveDialogSize(dialogConfig);
 }
 
-void DolphinSettingsDialog::slotButtonClicked(int button)
-{
-    if ((button == QDialogButtonBox::Ok) || (button == QDialogButtonBox::Apply)) {
-        applySettings();
-    } else if (button == QDialogButtonBox::RestoreDefaults) {
-        restoreDefaults();
-    }
-
-#pragma message("TODO: port")
-    //KPageDialog::slotButtonClicked(button);
-}
-
 void DolphinSettingsDialog::enableApply()
 {
     buttonBox()->button(QDialogButtonBox::Apply)->setEnabled(true);
@@ -156,4 +148,3 @@ void DolphinSettingsDialog::restoreDefaults()
     }
 }
 
-#include "dolphinsettingsdialog.moc"