]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Remember the used URL completion mode of the URL navigator. Thanks to Frank Reiningha...
authorPeter Penz <peter.penz19@gmail.com>
Fri, 20 Feb 2009 16:55:25 +0000 (16:55 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Fri, 20 Feb 2009 16:55:25 +0000 (16:55 +0000)
BUG: 170502

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

src/dolphinviewcontainer.cpp
src/dolphinviewcontainer.h
src/settings/dolphin_generalsettings.kcfg
src/settings/dolphinsettings.h

index 9da51a60c2a7424ee662a71cd4a4f5f7040f4c6f..95b16448a3b553d34aeb94a98ecbb514b287c9a3 100644 (file)
@@ -42,6 +42,7 @@
 #include <konq_fileitemcapabilities.h>
 #include <konq_operations.h>
 #include <kurl.h>
 #include <konq_fileitemcapabilities.h>
 #include <konq_operations.h>
 #include <kurl.h>
+#include <kurlcombobox.h>
 #include <krun.h>
 
 #include "dolphinmodel.h"
 #include <krun.h>
 
 #include "dolphinmodel.h"
@@ -87,11 +88,15 @@ DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow,
             this, SLOT(dropUrls(const KUrl&, QDropEvent*)));
     connect(m_urlNavigator, SIGNAL(activated()),
             this, SLOT(activate()));
             this, SLOT(dropUrls(const KUrl&, QDropEvent*)));
     connect(m_urlNavigator, SIGNAL(activated()),
             this, SLOT(activate()));
+    connect(m_urlNavigator->editor(), SIGNAL(completionModeChanged(KGlobalSettings::Completion)),
+            this, SLOT(saveUrlCompletionMode(KGlobalSettings::Completion)));
 
     const GeneralSettings* settings = DolphinSettings::instance().generalSettings();
     m_urlNavigator->setUrlEditable(settings->editableUrl());
     m_urlNavigator->setShowFullPath(settings->showFullPath());
     m_urlNavigator->setHomeUrl(settings->homeUrl());
 
     const GeneralSettings* settings = DolphinSettings::instance().generalSettings();
     m_urlNavigator->setUrlEditable(settings->editableUrl());
     m_urlNavigator->setShowFullPath(settings->showFullPath());
     m_urlNavigator->setHomeUrl(settings->homeUrl());
+    KUrlComboBox* editor = m_urlNavigator->editor();
+    editor->setCompletionMode(KGlobalSettings::Completion(settings->urlCompletionMode()));
 
     m_dirLister = new DolphinDirLister();
     m_dirLister->setAutoUpdate(true);
 
     m_dirLister = new DolphinDirLister();
     m_dirLister->setAutoUpdate(true);
@@ -433,6 +438,13 @@ void DolphinViewContainer::requestFocus()
     m_view->setFocus();
 }
 
     m_view->setFocus();
 }
 
+void DolphinViewContainer::saveUrlCompletionMode(KGlobalSettings::Completion completion)
+{
+    DolphinSettings& settings = DolphinSettings::instance();
+    settings.generalSettings()->setUrlCompletionMode(completion);
+    settings.save();
+}
+
 void DolphinViewContainer::slotItemTriggered(const KFileItem& item)
 {
     KUrl url = item.targetUrl();
 void DolphinViewContainer::slotItemTriggered(const KFileItem& item)
 {
     KUrl url = item.targetUrl();
index da317761b3d8cdb3424260f426d287afd201ae67..e6fd8fd0a04ff75c4eefa14db3306412ab10ef38 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <kfileitem.h>
 #include <kfileitemdelegate.h>
 
 #include <kfileitem.h>
 #include <kfileitemdelegate.h>
+#include <kglobalsettings.h>
 #include <kio/job.h>
 
 #include <kurlnavigator.h>
 #include <kio/job.h>
 
 #include <kurlnavigator.h>
@@ -236,6 +237,12 @@ private slots:
     /** Requests the focus for the view \a m_view. */
     void requestFocus();
 
     /** Requests the focus for the view \a m_view. */
     void requestFocus();
 
+    /**
+     * Saves the currently used URL completion mode of
+     * the URL navigator.
+     */
+    void saveUrlCompletionMode(KGlobalSettings::Completion completion);
+
 private:
     bool m_showProgress;
     bool m_isFolderWritable;
 private:
     bool m_showProgress;
     bool m_isFolderWritable;
index 2f4defa926a067ec27c8033acbcb6ae904c56797..0f3c677009ed6a7e4d489744b7b6d7f46ae52bdc 100644 (file)
@@ -3,11 +3,16 @@
 <kcfg>
     <kcfgfile name="dolphinrc"/>
     <include>QDir</include>
 <kcfg>
     <kcfgfile name="dolphinrc"/>
     <include>QDir</include>
+    <include>kglobalsettings.h</include>
     <group name="General">
         <entry name="EditableUrl" type="Bool">
             <label context="@label">Should the URL be editable for the user</label>
             <default>false</default>
         </entry>
     <group name="General">
         <entry name="EditableUrl" type="Bool">
             <label context="@label">Should the URL be editable for the user</label>
             <default>false</default>
         </entry>
+        <entry name="UrlCompletionMode" type="Enum">
+            <label context="@label">Text completion mode of the URL Navigator</label>
+            <default code="true">KGlobalSettings::completionMode()</default>
+        </entry>
         <entry name="ShowFullPath" type="Bool">
             <label context="@label">Should the full path be shown inside the location bar</label>
             <default>false</default>
         <entry name="ShowFullPath" type="Bool">
             <label context="@label">Should the full path be shown inside the location bar</label>
             <default>false</default>
index 55fa327ef83b304af261aac3713f576653b2f60d..54141ad3e094f282f618f512720ae82245b615fc 100644 (file)
@@ -36,6 +36,7 @@ class KFilePlacesModel;
  * - home URL
  * - default view mode
  * - URL navigator state (editable or not)
  * - home URL
  * - default view mode
  * - URL navigator state (editable or not)
+ * - Text completion state
  * - split view
  * - properties for views
  */
  * - split view
  * - properties for views
  */