]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/generalsettingspage.cpp
Make it configurable whether a browsing through archives should be done. The default...
[dolphin.git] / src / generalsettingspage.cpp
index 4aa762b8890cbb30cea2403b423b4668a6257cd5..ac24f2a574ff0605d7d692ddee9dcd60416a3ff0 100644 (file)
@@ -48,7 +48,8 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* pa
     m_filterBar(0),
     m_showDeleteCommand(0),
     m_confirmMoveToTrash(0),
-    m_confirmDelete(0)
+    m_confirmDelete(0),
+    m_browseThroughArchives(0)
 {
     const int spacing = KDialog::spacingHint();
 
@@ -109,6 +110,8 @@ GeneralSettingsPage::GeneralSettingsPage(DolphinMainWindow* mainWin, QWidget* pa
     // create 'Show the command 'Delete' in context menu' checkbox
     m_showDeleteCommand = new QCheckBox(i18nc("@option:check", "Show 'Delete' command in context menu"), vBox);
 
+    m_browseThroughArchives = new QCheckBox(i18nc("option:check", "Browse through archives"), vBox);
+
     // Add a dummy widget with no restriction regarding
     // a vertical resizing. This assures that the dialog layout
     // is not stretched vertically.
@@ -137,16 +140,17 @@ void GeneralSettingsPage::applySettings()
     settings->setEditableUrl(m_editableUrl->isChecked());
     settings->setFilterBar(m_filterBar->isChecked());
 
-    KSharedConfig::Ptr globalConfig = KSharedConfig::openConfig("kdeglobals");
-
-    KConfigGroup trashConfig(globalConfig, "Trash");
+    KSharedConfig::Ptr konqConfig = KSharedConfig::openConfig("konquerorrc", KConfig::IncludeGlobals);
+    KConfigGroup trashConfig(konqConfig, "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();
+
+    settings->setBrowseThroughArchives(m_browseThroughArchives->isChecked());
 }
 
 void GeneralSettingsPage::restoreDefaults()
@@ -155,9 +159,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,14 +191,15 @@ 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");
+    KSharedConfig::Ptr konqConfig = KSharedConfig::openConfig("konquerorrc", KConfig::IncludeGlobals);
+    const KConfigGroup trashConfig(konqConfig, "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));
+
+    m_browseThroughArchives->setChecked(settings->browseThroughArchives());
 }
 
 #include "generalsettingspage.moc"