diff options
| author | Peter Penz <[email protected]> | 2009-02-20 16:55:25 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2009-02-20 16:55:25 +0000 |
| commit | 540eeb0030470d50a61e192d9348043ffd10f056 (patch) | |
| tree | 74fdd2d018d1686bd876b7b57ec47b8ce952e8aa /src | |
| parent | 264531e8e1ecba7a39d897d11238d5351b24cf5b (diff) | |
Remember the used URL completion mode of the URL navigator. Thanks to Frank Reininghaus for the patch!
BUG: 170502
svn path=/trunk/KDE/kdebase/apps/; revision=929111
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinviewcontainer.cpp | 12 | ||||
| -rw-r--r-- | src/dolphinviewcontainer.h | 7 | ||||
| -rw-r--r-- | src/settings/dolphin_generalsettings.kcfg | 5 | ||||
| -rw-r--r-- | src/settings/dolphinsettings.h | 1 |
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 */ |
