]> cloud.milkyroute.net Git - dolphin.git/commitdiff
use KGlobal::config() instead of parsing kdeglobals each time (thanks to David for...
authorPeter Penz <peter.penz19@gmail.com>
Mon, 15 Oct 2007 14:34:12 +0000 (14:34 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Mon, 15 Oct 2007 14:34:12 +0000 (14:34 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=725485

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

index cbc1893c9819ca526164b85db3b51719201f7648..4b58809bd9277b0ec2896a15629bbf128dd8312c 100644 (file)
@@ -277,8 +277,7 @@ void DolphinContextMenu::insertDefaultItemActions(KMenu* popup)
     popup->addAction(renameAction);
 
     // insert 'Move to Trash' and (optionally) 'Delete'
-    const KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals");
-    const KConfigGroup kdeConfig(globalConfig, "KDE");
+    KConfigGroup kdeConfig(KGlobal::config(), "KDE");
     bool showDeleteCommand = kdeConfig.readEntry("ShowDeleteCommand", false);
     const KUrl& url = m_mainWindow->activeViewContainer()->url();
     if (url.isLocalFile()) {
index 4aa762b8890cbb30cea2403b423b4668a6257cd5..5584350b3e28028de1331c7bc9082e70d1ce35f7 100644 (file)
@@ -137,14 +137,12 @@ void GeneralSettingsPage::applySettings()
     settings->setEditableUrl(m_editableUrl->isChecked());
     settings->setFilterBar(m_filterBar->isChecked());
 
-    KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals");
-
-    KConfigGroup trashConfig(globalConfig, "Trash");
+    KConfigGroup trashConfig(KGlobal::config(), "Trash");
     trashConfig.writeEntry("ConfirmTrash", m_confirmMoveToTrash->isChecked());
     trashConfig.writeEntry("ConfirmDelete", m_confirmDelete->isChecked());
     trashConfig.sync();
 
-    KConfigGroup kdeConfig(globalConfig, "KDE");
+    KConfigGroup kdeConfig(KGlobal::config(), "KDE");
     kdeConfig.writeEntry("ShowDeleteCommand", m_showDeleteCommand->isChecked());
     kdeConfig.sync();
 }
@@ -155,9 +153,6 @@ void GeneralSettingsPage::restoreDefaults()
     settings->setDefaults();
 
     // TODO: reset default settings for trash and show delete command...
-    //KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals");
-    //KConfigGroup trashConfig(konqConfig, "Trash");
-    //KConfigGroup kdeConfig(globalConfig, "KDE");
 
     loadSettings();
 }
@@ -190,13 +185,11 @@ void GeneralSettingsPage::loadSettings()
     m_editableUrl->setChecked(settings->editableUrl());
     m_filterBar->setChecked(settings->filterBar());
 
-    const KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals");
-
-    const KConfigGroup trashConfig(globalConfig, "Trash");
+    const KConfigGroup trashConfig(KGlobal::config(), "Trash");
     m_confirmMoveToTrash->setChecked(trashConfig.readEntry("ConfirmTrash", false));
     m_confirmDelete->setChecked(trashConfig.readEntry("ConfirmDelete", true));
 
-    const KConfigGroup kdeConfig(globalConfig, "KDE");
+    const KConfigGroup kdeConfig(KGlobal::config(), "KDE");
     m_showDeleteCommand->setChecked(kdeConfig.readEntry("ShowDeleteCommand", false));
 }
 
index b53241b18ecebb99599b08e96e1ac0b80512214d..d095ee13d00d1397ea1f19eccfe9acb9ca22b6f9 100644 (file)
@@ -75,8 +75,7 @@ void TreeViewContextMenu::open()
     popup->addAction(renameAction);
 
     // insert 'Move to Trash' and (optionally) 'Delete'
-    const KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals");
-    const KConfigGroup kdeConfig(globalConfig, "KDE");
+    KConfigGroup kdeConfig(KGlobal::config(), "KDE");
     bool showDeleteCommand = kdeConfig.readEntry("ShowDeleteCommand", false);
     const KUrl& url = m_fileInfo.url();
     if (url.isLocalFile()) {