From 8d92c8be7f117dee18710ee1ba6b7cfa45d3f5f0 Mon Sep 17 00:00:00 2001 From: Ismael Asensio Date: Wed, 13 Nov 2019 22:16:35 +0100 Subject: refactor(search): De-couple baloo URL parsing logic from UI Summary: Extracts the logic that parses `baloosearch:` urls into a new model class. The parser logic itself is kept as is. The search box UI is later updated using the model fields. This refactor has been proposed by @bruns in the review of D24422, as it largely simplifies the unit tests and further expansion/improvements. Test Plan: No behavior changes. Test case is added in the follow-up revision: D25258 Reviewers: #dolphin, elvisangelaccio, bruns Reviewed By: #dolphin, elvisangelaccio, bruns Subscribers: ngraham, bruns, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D25257 --- src/search/dolphinsearchbox.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/search/dolphinsearchbox.h') diff --git a/src/search/dolphinsearchbox.h b/src/search/dolphinsearchbox.h index 241dc40c1..5fef4ec5a 100644 --- a/src/search/dolphinsearchbox.h +++ b/src/search/dolphinsearchbox.h @@ -24,6 +24,7 @@ #include class DolphinFacetsWidget; +class DolphinQuery; class QLineEdit; class KSeparator; class QToolButton; @@ -152,10 +153,9 @@ private: QUrl balooUrlForSearching() const; /** - * Extracts information from the given Baloo search \a url to - * initialize the search box properly. + * Sets the searchbox UI with the parameters established by the \a query */ - void fromBalooSearchUrl(const QUrl& url); + void updateFromQuery(const DolphinQuery& query); void updateFacetsVisible(); -- cgit v1.3