┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-10-15 14:34:12 +0000
committerPeter Penz <[email protected]>2007-10-15 14:34:12 +0000
commita23a882c68fb399f895ebed253cf2ad09944a347 (patch)
tree3a0ba4b17b3332aed17a70f3c8988336c0385b2f
parente773e646834a694a90b2096c1b3d1601cbbca4a6 (diff)
use KGlobal::config() instead of parsing kdeglobals each time (thanks to David for the hint!)
svn path=/trunk/KDE/kdebase/apps/; revision=725485
-rw-r--r--src/dolphincontextmenu.cpp3
-rw-r--r--src/generalsettingspage.cpp15
-rw-r--r--src/treeviewcontextmenu.cpp3
3 files changed, 6 insertions, 15 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index cbc1893c9..4b58809bd 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -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()) {
diff --git a/src/generalsettingspage.cpp b/src/generalsettingspage.cpp
index 4aa762b88..5584350b3 100644
--- a/src/generalsettingspage.cpp
+++ b/src/generalsettingspage.cpp
@@ -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));
}
diff --git a/src/treeviewcontextmenu.cpp b/src/treeviewcontextmenu.cpp
index b53241b18..d095ee13d 100644
--- a/src/treeviewcontextmenu.cpp
+++ b/src/treeviewcontextmenu.cpp
@@ -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()) {