]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/search/dolphinsearchbox.cpp
[search] Do not update text input when it has focus
[dolphin.git] / src / search / dolphinsearchbox.cpp
index f0d8c541653478c3b71f18cc0df3a2548baeea54..20a527ff4672d6dd204eca7ab0bd3254079f65e0 100644 (file)
@@ -146,8 +146,8 @@ QUrl DolphinSearchBox::urlForSearching() const
 
 void DolphinSearchBox::fromSearchUrl(const QUrl& url)
 {
-    if (url.scheme() == QLatin1String("baloosearch")) {
-        const DolphinQuery query = DolphinQuery::fromBalooSearchUrl(url);
+    if (DolphinQuery::supportsScheme(url.scheme())) {
+        const DolphinQuery query = DolphinQuery::fromSearchUrl(url);
         updateFromQuery(query);
     } else if (url.scheme() == QLatin1String("filenamesearch")) {
         const QUrlQuery query(url);
@@ -520,7 +520,10 @@ void DolphinSearchBox::updateFromQuery(const DolphinQuery& query)
         setSearchPath(QUrl::fromLocalFile(QDir::homePath()));
     }
 
-    setText(query.text());
+    // If the input box has focus, do not update to avoid messing with user typing
+    if (!m_searchInput->hasFocus()) {
+        setText(query.text());
+    }
 
     if (query.hasContentSearch()) {
         m_contentButton->setChecked(true);