From 984c20161bc71684325a1394cfbb292683c94d53 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Thu, 10 Mar 2011 23:17:55 +0100 Subject: Add search modes for the Search Panel The search panel must get a hint whether clicking on the facets should result in searching everywhere or from the current folder. It is not sufficient to check the search-settings of the "Find:"-box, as when the "Find:"-box is invisible there is no hint for the user what kind of searching is done and the setting must be ignored. --- src/panels/search/searchpanel.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/panels/search/searchpanel.h') diff --git a/src/panels/search/searchpanel.h b/src/panels/search/searchpanel.h index 2e0ef669b..9404b4f8c 100644 --- a/src/panels/search/searchpanel.h +++ b/src/panels/search/searchpanel.h @@ -32,16 +32,33 @@ namespace Nepomuk { } /** - * @brief Allows the filtering of search results. + * @brief Allows to search for files by enabling generic search patterns (= facets). + * + * For example it is possible to search for images, documents or specific tags. + * The search panel can be adjusted to search only from the current folder or everywhere. */ class SearchPanel : public Panel { Q_OBJECT public: + enum SearchMode + { + Everywhere, + FromCurrentDir + }; + SearchPanel(QWidget* parent = 0); virtual ~SearchPanel(); + /** + * Specifies whether a searching is done in all folders (= Everywhere) + * or from the current directory (= FromCurrentDir). The current directory + * is automatically determined when setUrl() has been called. + */ + void setSearchMode(SearchMode mode); + SearchMode searchMode() const; + signals: void urlActivated(const KUrl& url); @@ -67,6 +84,7 @@ private: private: bool m_initialized; + SearchMode m_searchMode; KJob* m_lastSetUrlStatJob; KUrl m_startedFromDir; -- cgit v1.3.1