From: Peter Penz Date: Thu, 7 Aug 2008 21:44:35 +0000 (+0000) Subject: use the global setting for the "Show Delete" command X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/17dca27e615fa63ac6b8d7bf3aabfdbd9d71e0f5 use the global setting for the "Show Delete" command CCMAIL: kde@randomguy3.me.uk svn path=/trunk/KDE/kdebase/apps/; revision=843787 --- diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp index 1af74b2e3..8e3d02fdf 100644 --- a/src/dolphincontextmenu.cpp +++ b/src/dolphincontextmenu.cpp @@ -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"); diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 1cdf73f3e..45fc99115 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -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; } } diff --git a/src/generalsettingspage.cpp b/src/generalsettingspage.cpp index dc891a074..5dc66cbdc 100644 --- a/src/generalsettingspage.cpp +++ b/src/generalsettingspage.cpp @@ -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()); diff --git a/src/treeviewcontextmenu.cpp b/src/treeviewcontextmenu.cpp index 60fe3c983..20840060e 100644 --- a/src/treeviewcontextmenu.cpp +++ b/src/treeviewcontextmenu.cpp @@ -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"),