diff options
| author | Peter Penz <[email protected]> | 2007-02-25 22:42:47 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2007-02-25 22:42:47 +0000 |
| commit | 6c4e3aee2a65969d25813d9809bffca23fbe18d3 (patch) | |
| tree | b93181fd381efbf9a812c9d0cfeeb201ed0b8fc8 | |
| parent | d9c3648d5a4601d8e11e148ca77b3e9d84cf3207 (diff) | |
As Aaron suggested: use the global setting for "Show Delete command" instead of using a custom Dolphin setting. I hope I used the reworked KConfig classes in a correct manner (setGroup() has been marked as deprecated, Konqueror still uses those deprecated methods).
svn path=/trunk/KDE/kdebase/apps/; revision=637272
| -rw-r--r-- | src/dolphin_generalsettings.kcfg | 4 | ||||
| -rw-r--r-- | src/dolphincontextmenu.cpp | 6 | ||||
| -rw-r--r-- | src/generalsettingspage.cpp | 11 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/dolphin_generalsettings.kcfg b/src/dolphin_generalsettings.kcfg index 9f9f3e56b..37fe8d18e 100644 --- a/src/dolphin_generalsettings.kcfg +++ b/src/dolphin_generalsettings.kcfg @@ -23,10 +23,6 @@ <label>Should the view properties used for all directories</label> <default>false</default> </entry> - <entry name="ShowDeleteCommand" type="Bool"> - <label>Should the command 'Delete' be shown in the context menu</label> - <default>false</default> - </entry> <entry name="ViewPropsTimestamp" type="DateTime" > <label>Timestamp since when the view properties are valid</label> </entry> diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 14f71f449..346ee6401 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -25,8 +25,6 @@ #include "dolphinview.h" #include "editbookmarkdialog.h" -#include "dolphin_generalsettings.h" - #include <assert.h> #include <kactioncollection.h> @@ -154,7 +152,9 @@ void DolphinContextMenu::openItemContextMenu() popup->addAction(renameAction); // insert 'Move to Trash' and (optionally) 'Delete' - bool showDeleteCommand = DolphinSettings::instance().generalSettings()->showDeleteCommand(); + const KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals); + const KConfigGroup kdeConfig(globalConfig, "KDE"); + bool showDeleteCommand = kdeConfig.readEntry("ShowDeleteCommand", false); const KUrl& url = dolphin->activeView()->url(); if (url.isLocalFile()) { QAction* moveToTrashAction = dolphin->actionCollection()->action("move_to_trash"); diff --git a/src/generalsettingspage.cpp b/src/generalsettingspage.cpp index ba5473054..8d1389b59 100644 --- a/src/generalsettingspage.cpp +++ b/src/generalsettingspage.cpp @@ -95,8 +95,9 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin,QWidget* par startBoxLayout->addWidget(m_startEditable); m_showDeleteCommand = new QCheckBox(i18n("Show the command 'Delete' in context menu"), vBox); - // TODO: use global config like in Konqueror or is this a custom setting for Dolphin? - m_showDeleteCommand->setChecked(settings->showDeleteCommand()); + const KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals); + const KConfigGroup kdeConfig(globalConfig, "KDE"); + m_showDeleteCommand->setChecked(kdeConfig.readEntry("ShowDeleteCommand", false)); // Add a dummy widget with no restriction regarding // a vertical resizing. This assures that the dialog layout @@ -123,7 +124,11 @@ void GeneralSettingsPage::applySettings() settings->setSplitView(m_startSplit->isChecked()); settings->setEditableUrl(m_startEditable->isChecked()); - settings->setShowDeleteCommand(m_showDeleteCommand->isChecked()); + + KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals); + KConfigGroup kdeConfig(globalConfig, "KDE"); + kdeConfig.writeEntry("ShowDeleteCommand", m_showDeleteCommand->isChecked()); + kdeConfig.sync(); } void GeneralSettingsPage::selectHomeUrl() |
