- const bool recursive = true;
- fileQuery.addIncludeFolder(m_searchPath, recursive);
+ query.setIncludeFolder(m_searchPath.toLocalFile());
+ }
+
+ query.setSearchString(queryStrings.join(QStringLiteral(" ")));
+
+ return query.toSearchUrl(i18nc("@title UDS_DISPLAY_NAME for a KIO directory listing. %1 is the query the user entered.",
+ "Query Results from '%1'", text));
+#else
+ return QUrl();
+#endif
+}
+
+void DolphinSearchBox::fromBalooSearchUrl(const QUrl& url)
+{
+#ifdef HAVE_BALOO
+ const Baloo::Query query = Baloo::Query::fromSearchUrl(url);
+
+ // Block all signals to avoid unnecessary "searchRequest" signals
+ // while we adjust the search text and the facet widget.
+ blockSignals(true);
+
+ const QString customDir = query.includeFolder();
+ if (!customDir.isEmpty()) {
+ setSearchPath(QUrl::fromLocalFile(customDir));
+ } else {
+ setSearchPath(QUrl::fromLocalFile(QDir::homePath()));