diff options
| author | Emmanuel Pescosta <[email protected]> | 2014-03-28 18:48:48 +0100 |
|---|---|---|
| committer | Emmanuel Pescosta <[email protected]> | 2014-03-28 18:48:48 +0100 |
| commit | 5d63b9a111e6ae76ff7b9f5ba9cd26be873aa115 (patch) | |
| tree | 2ea10c0569e29c258330d6fe19fbe24dd5d88b7f /src/search/dolphinsearchbox.h | |
| parent | 5c2f52e62a7cfef961c2f67585c84c04b4193370 (diff) | |
When you open a new tab while the search mode is enabled, the
newly opened tab also starts the same search (Because new tab is opened with
the current view url), but the search box is in read-only mode. So you cannot
close the search bar nor edit the search text.
This patch fixes this by parsing the search url. The value of the "search"
parameter is used as search text and the value of the "url" parameter is used
for the search path ("root" folder for the search when "Search from here" mode
is enabled).
In case of Baloo search urls, we use Baloo::Query::fromSearchUrl.
Removed everything related to read only mode in DolphinSearchBox, not needed
anymore.
REVIEW: 111968
BUG: 311950
FIXED-IN: 4.13.0
Diffstat (limited to 'src/search/dolphinsearchbox.h')
| -rw-r--r-- | src/search/dolphinsearchbox.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h index 6dc09f19e..53b12ffab 100644 --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -72,20 +72,15 @@ public: KUrl urlForSearching() const; /** - * Selects the whole text of the search box. + * Extracts information from the given search \a url to + * initialize the search box properly. */ - void selectAll(); + void fromSearchUrl(const KUrl& url); /** - * @param readOnly If set to true the searchbox cannot be modified - * by the user and acts as visual indicator for - * an externally triggered search query. - * @param query If readOnly is true this URL will be used - * to show a human readable information about the - * query. + * Selects the whole text of the search box. */ - void setReadOnly(bool readOnly, const KUrl& query = KUrl()); - bool isReadOnly() const; + void selectAll(); /** * Set the search box to the active mode, if \a active @@ -155,12 +150,15 @@ private: */ KUrl balooUrlForSearching() const; - void applyReadOnlyState(); + /** + * Extracts information from the given Baloo search \a url to + * initialize the search box properly. + */ + void fromBalooSearchUrl(const KUrl& url); void updateFacetsToggleButton(); private: bool m_startedSearching; - bool m_readOnly; bool m_active; QVBoxLayout* m_topLayout; @@ -177,7 +175,6 @@ private: DolphinFacetsWidget* m_facetsWidget; KUrl m_searchPath; - KUrl m_readOnlyQuery; QTimer* m_startSearchTimer; }; |
