┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dolphinviewcontainer.cpp12
-rw-r--r--src/dolphinviewcontainer.h7
-rw-r--r--src/settings/dolphin_generalsettings.kcfg5
-rw-r--r--src/settings/dolphinsettings.h1
4 files changed, 25 insertions, 0 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index 9da51a60c..95b16448a 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -42,6 +42,7 @@
#include <konq_fileitemcapabilities.h>
#include <konq_operations.h>
#include <kurl.h>
+#include <kurlcombobox.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()));
+ 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());
+ KUrlComboBox* editor = m_urlNavigator->editor();
+ editor->setCompletionMode(KGlobalSettings::Completion(settings->urlCompletionMode()));
m_dirLister = new DolphinDirLister();
m_dirLister->setAutoUpdate(true);
@@ -433,6 +438,13 @@ void DolphinViewContainer::requestFocus()
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();
diff --git a/src/dolphinviewcontainer.h b/src/dolphinviewcontainer.h
index da317761b..e6fd8fd0a 100644
--- a/src/dolphinviewcontainer.h
+++ b/src/dolphinviewcontainer.h
@@ -25,6 +25,7 @@
#include <kfileitem.h>
#include <kfileitemdelegate.h>
+#include <kglobalsettings.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();
+ /**
+ * Saves the currently used URL completion mode of
+ * the URL navigator.
+ */
+ void saveUrlCompletionMode(KGlobalSettings::Completion completion);
+
private:
bool m_showProgress;
bool m_isFolderWritable;
diff --git a/src/settings/dolphin_generalsettings.kcfg b/src/settings/dolphin_generalsettings.kcfg
index 2f4defa92..0f3c67700 100644
--- a/src/settings/dolphin_generalsettings.kcfg
+++ b/src/settings/dolphin_generalsettings.kcfg
@@ -3,11 +3,16 @@
<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>
+ <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>
diff --git a/src/settings/dolphinsettings.h b/src/settings/dolphinsettings.h
index 55fa327ef..54141ad3e 100644
--- a/src/settings/dolphinsettings.h
+++ b/src/settings/dolphinsettings.h
@@ -36,6 +36,7 @@ class KFilePlacesModel;
* - home URL
* - default view mode
* - URL navigator state (editable or not)
+ * - Text completion state
* - split view
* - properties for views
*/