From 73c30c7ea25891d3579277734393b70d9d1e2ab3 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Thu, 10 May 2012 23:26:29 +0200 Subject: Allow to remember view-properties for the search-mode Per default Dolphin remembers the view-properties for each search-URL individually. However when being in the search-mode, where the search-URL is different each time by definition, it should also be possible for the user to adjust the view-properties. The DolphinView is not aware about any "search-mode", so an interface has been added to provide a "context" for storing the view-properties. The context will be adjusted by the DolphinViewContainer in case if the search-mode is active. --- src/views/dolphinview.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/views/dolphinview.h') diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index bfac88502..b2c4121a0 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -286,6 +286,16 @@ public: */ KFileItem rootItem() const; + /** + * Sets a context that is used for remembering the view-properties. + * Per default the context is empty and the path of the currently set URL + * is used for remembering the view-properties. Setting a custom context + * makes sense if specific types of URLs (e.g. search-URLs) should + * share common view-properties. + */ + void setViewPropertiesContext(const QString& context); + QString viewPropertiesContext() const; + public slots: /** * Changes the directory to \a url. If the current directory is equal to @@ -707,6 +717,13 @@ private: */ void updateWritableState(); + /** + * @return The current URL if no viewproperties-context is given (see + * DolphinView::viewPropertiesContext(), otherwise the context + * is returned. + */ + KUrl viewPropertiesUrl() const; + private: bool m_active; bool m_tabsForFiles; @@ -716,6 +733,7 @@ private: // tooltip may be shown when hovering an item. KUrl m_url; + QString m_viewPropertiesContext; Mode m_mode; QList m_visibleRoles; -- cgit v1.3