]> cloud.milkyroute.net Git - dolphin.git/commitdiff
As Aaron suggested: use the global setting for "Show Delete command" instead of using...
authorPeter Penz <peter.penz19@gmail.com>
Sun, 25 Feb 2007 22:42:47 +0000 (22:42 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 25 Feb 2007 22:42:47 +0000 (22:42 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=637272

src/dolphin_generalsettings.kcfg
src/dolphincontextmenu.cpp
src/generalsettingspage.cpp

index 9f9f3e56ba616a12e11826b91f3063a5c7077e44..37fe8d18eec01f5343e6deafc759f0f0f8c0cd6d 100644 (file)
             <label>Should the view properties used for all directories</label>
             <default>false</default>
         </entry>
             <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>
         <entry name="ViewPropsTimestamp" type="DateTime" >
             <label>Timestamp since when the view properties are valid</label>
         </entry>
index 14f71f44953898aab65c0dba917ffe70a3125357..346ee64013fc9bd327c1350609f11aaccceb3849 100644 (file)
@@ -25,8 +25,6 @@
 #include "dolphinview.h"
 #include "editbookmarkdialog.h"
 
 #include "dolphinview.h"
 #include "editbookmarkdialog.h"
 
-#include "dolphin_generalsettings.h"
-
 #include <assert.h>
 
 #include <kactioncollection.h>
 #include <assert.h>
 
 #include <kactioncollection.h>
@@ -154,7 +152,9 @@ void DolphinContextMenu::openItemContextMenu()
     popup->addAction(renameAction);
 
     // insert 'Move to Trash' and (optionally) 'Delete'
     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");
     const KUrl& url = dolphin->activeView()->url();
     if (url.isLocalFile()) {
         QAction* moveToTrashAction = dolphin->actionCollection()->action("move_to_trash");
index ba5473054c9efcf513905955b8a3525e3b3da2ac..8d1389b594563fe6a3307390933e3ec7ee4bafc6 100644 (file)
@@ -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);
     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
 
     // 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->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()
 }
 
 void GeneralSettingsPage::selectHomeUrl()