]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/search/dolphinquery.h
Expand DolphinQuery to support different Url schemes
[dolphin.git] / src / search / dolphinquery.h
index e60008e3bf8ca7d23f3fd42b171afe59318d70fe..5032621a9e1d9569ae5f328f750dd5fd3d637a5c 100644 (file)
 class DolphinQuery
 {
 public:
-    /** Calls Baloo::Query::fromSearchUrl() with the given @p searchUrl
-     * and parses the result to extract its separate components */
-    static DolphinQuery fromBalooSearchUrl(const QUrl& searchUrl);
+    /** Parses the components of @p searchUrl for the supported schemes */
+    static DolphinQuery fromSearchUrl(const QUrl& searchUrl);
+    /** Checks whether the DolphinQuery supports the given @p urlScheme */
+    static bool supportsScheme(const QString& urlScheme);
 
     /** @return the \a searchUrl passed to Baloo::Query::fromSearchUrl() */
     QUrl searchUrl() const;
@@ -48,6 +49,15 @@ public:
     /** @return Baloo::Query::includeFolder(), that is, the initial directory
      * for the query or an empty string if its a global search" */
     QString includeFolder() const;
+    /** @return whether the query includes search in file content */
+    bool hasContentSearch() const;
+    /** @return whether the query includes a filter by fileName */
+    bool hasFileName() const;
+
+private:
+    /** Calls Baloo::Query::fromSearchUrl() on the current searchUrl
+     * and parses the result to extract its separate components */
+    void parseBalooQuery();
 
 private:
     QUrl m_searchUrl;
@@ -55,6 +65,8 @@ private:
     QString m_fileType;
     QStringList m_searchTerms;
     QString m_includeFolder;
+    bool m_hasContentSearch = false;
+    bool m_hasFileName = false;
 };
 
 #endif //DOLPHINQUERY_H