┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2014-06-06 00:51:15 +0200
committerFrank Reininghaus <[email protected]>2014-06-06 00:51:15 +0200
commit05c8254ee47cb668771bb4009209122364e8a2a6 (patch)
treefd2c35f5e8b191945b7e0658c6c817d5b8cf4db2 /src
parentc12dc996f535f787ab828560068a2c8b7f98c5cf (diff)
Make the settings dialog work in the frameworks branch
The KF5 version of KPageDialog has no virtual slot "slotButtonClicked(int button)". Its kdelibs 4.x counterpart had such a slot, which was connected automatically to the corresponding signal. This slot was overriden by DolphinSettingsDialog::slotButtonClicked(int button) which was responsible for applying the changed setting and restoring the default values if the corresponding button was clicked. The lack of the buttonClicked(int) signal and the corresponding slot caused the problem that clicking a button in the settings dialog had no effect. This patch makes the functions applySettings() and restoreDefaults() functions slots, and connects them directly to the "clicked" signal of the corresponding buttons. BUG: 335709 REVIEW: 118576
Diffstat (limited to 'src')
-rw-r--r--src/settings/dolphinsettingsdialog.cpp16
-rw-r--r--src/settings/dolphinsettingsdialog.h6
2 files changed, 4 insertions, 18 deletions
diff --git a/src/settings/dolphinsettingsdialog.cpp b/src/settings/dolphinsettingsdialog.cpp
index 8df2996b3..f248335e9 100644
--- a/src/settings/dolphinsettingsdialog.cpp
+++ b/src/settings/dolphinsettingsdialog.cpp
@@ -53,6 +53,10 @@ 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,
@@ -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);
diff --git a/src/settings/dolphinsettingsdialog.h b/src/settings/dolphinsettingsdialog.h
index 2de195017..56d924c7d 100644
--- a/src/settings/dolphinsettingsdialog.h
+++ b/src/settings/dolphinsettingsdialog.h
@@ -42,15 +42,9 @@ public:
signals:
void settingsChanged();
-protected slots:
- /** @see KDialog::slotButtonClicked() */
- virtual void slotButtonClicked(int button);
-
private slots:
/** Enables the Apply button. */
void enableApply();
-
-private:
void applySettings();
void restoreDefaults();