]> cloud.milkyroute.net Git - dolphin.git/commitdiff
use the global setting for the "Show Delete" command
authorPeter Penz <peter.penz19@gmail.com>
Thu, 7 Aug 2008 21:44:35 +0000 (21:44 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Thu, 7 Aug 2008 21:44:35 +0000 (21:44 +0000)
CCMAIL: kde@randomguy3.me.uk

svn path=/trunk/KDE/kdebase/apps/; revision=843787

src/dolphincontextmenu.cpp
src/dolphinpart.cpp
src/generalsettingspage.cpp
src/treeviewcontextmenu.cpp

index 1af74b2e31715f0034ba6e8f8c01da5d9c9c137a..8e3d02fdf9fb576d500886b84857ab578b322de1 100644 (file)
@@ -296,8 +296,10 @@ void DolphinContextMenu::insertDefaultItemActions(KMenu* popup)
     popup->addAction(renameAction);
 
     // insert 'Move to Trash' and (optionally) 'Delete'
-    KConfigGroup kdeConfig(KGlobal::config(), "KDE");
-    bool showDeleteCommand = kdeConfig.readEntry("ShowDeleteCommand", false);
+    KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::IncludeGlobals);
+    KConfigGroup configGroup(globalConfig, "KDE");
+    bool showDeleteCommand = configGroup.readEntry("ShowDeleteCommand", false);
+    
     const KUrl& url = m_mainWindow->activeViewContainer()->url();
     if (url.isLocalFile()) {
         QAction* moveToTrashAction = collection->action("move_to_trash");
index 1cdf73f3e2dc5d80265e78f23f267e748abd82dd..45fc9911593e93de654f8ab51558bd396818cb83 100644 (file)
@@ -367,8 +367,9 @@ void DolphinPart::slotOpenContextMenu(const KFileItem& _item, const KUrl&)
                 addDel = true;
             }
             else {
-                KConfigGroup configGroup( KGlobal::config(), "KDE" );
-                if ( configGroup.readEntry( "ShowDeleteCommand", false) )
+                KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::IncludeGlobals);
+                KConfigGroup configGroup(globalConfig, "KDE");
+                if ( configGroup.readEntry("ShowDeleteCommand", false) )
                     addDel = true;
             }
         }
index dc891a0741f59093da2cf39432453d4df1426d39..5dc66cbdcf7bc437d0a27faf6e4221094ddaac74 100644 (file)
@@ -106,9 +106,10 @@ void GeneralSettingsPage::applySettings()
     confirmationGroup.writeEntry("ConfirmDelete", m_confirmDelete->isChecked());
     confirmationGroup.sync();
 
-    KConfigGroup kdeConfig(KGlobal::config(), "KDE");
-    kdeConfig.writeEntry("ShowDeleteCommand", m_showDeleteCommand->isChecked());
-    kdeConfig.sync();
+    KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::NoGlobals);
+    KConfigGroup configGroup(globalConfig, "KDE");
+    configGroup.writeEntry("ShowDeleteCommand", m_showDeleteCommand->isChecked());
+    configGroup.sync();
 
     settings->setShowCopyMoveMenu(m_showCopyMoveMenu->isChecked());
     settings->setBrowseThroughArchives(m_browseThroughArchives->isChecked());
@@ -132,9 +133,10 @@ void GeneralSettingsPage::loadSettings()
     m_confirmMoveToTrash->setChecked(confirmationGroup.readEntry("ConfirmTrash", false));
     m_confirmDelete->setChecked(confirmationGroup.readEntry("ConfirmDelete", true));
 
-    const KConfigGroup kdeConfig(KGlobal::config(), "KDE");
-    m_showDeleteCommand->setChecked(kdeConfig.readEntry("ShowDeleteCommand", false));
-
+    KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::IncludeGlobals);
+    KConfigGroup configGroup(globalConfig, "KDE");
+    m_showDeleteCommand->setChecked(configGroup.readEntry("ShowDeleteCommand", false));
+    
     GeneralSettings* settings = DolphinSettings::instance().generalSettings();
     m_showCopyMoveMenu->setChecked(settings->showCopyMoveMenu());
     m_browseThroughArchives->setChecked(settings->browseThroughArchives());
index 60fe3c98321cbed56d9f9d0acf439e4db131336b..20840060eec89e5ad135628e66d5539a031d1308 100644 (file)
@@ -82,8 +82,10 @@ void TreeViewContextMenu::open()
         popup->addAction(renameAction);
 
         // insert 'Move to Trash' and (optionally) 'Delete'
-        KConfigGroup kdeConfig(KGlobal::config(), "KDE");
-        bool showDeleteCommand = kdeConfig.readEntry("ShowDeleteCommand", false);
+        KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals", KConfig::IncludeGlobals);
+        KConfigGroup configGroup(globalConfig, "KDE");
+        bool showDeleteCommand = configGroup.readEntry("ShowDeleteCommand", false);
+        
         const KUrl& url = m_fileInfo.url();
         if (url.isLocalFile()) {
             QAction* moveToTrashAction = new QAction(KIcon("user-trash"),