]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/search/dolphinsearchbox.h
Hide search extra options when not available
[dolphin.git] / src / search / dolphinsearchbox.h
index ef48d08308320b8a30799004c1ac80843bfc6cc6..e70317450707f7b01cf4a49075bbb96db4b7a0a3 100644 (file)
@@ -23,8 +23,6 @@
 #include <QUrl>
 #include <QWidget>
 
-#include <config-baloo.h>
-
 class DolphinFacetsWidget;
 class QLineEdit;
 class KSeparator;
@@ -32,11 +30,7 @@ class QToolButton;
 class QScrollArea;
 class QLabel;
 class QVBoxLayout;
-
-namespace Baloo {
-    class QueryBuilder;
-    class NaturalQueryParser;
-}
+class KMoreToolsMenuFactory;
 
 /**
  * @brief Input box for searching files with or without Baloo.
@@ -52,8 +46,8 @@ class DolphinSearchBox : public QWidget {
     Q_OBJECT
 
 public:
-    explicit DolphinSearchBox(QWidget* parent = 0);
-    virtual ~DolphinSearchBox();
+    explicit DolphinSearchBox(QWidget* parent = nullptr);
+    ~DolphinSearchBox() override;
 
     /**
      * Sets the text that should be used as input for
@@ -105,10 +99,11 @@ public:
     bool isActive() const;
 
 protected:
-    virtual bool event(QEvent* event) Q_DECL_OVERRIDE;
-    virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
-    virtual void keyReleaseEvent(QKeyEvent* event) Q_DECL_OVERRIDE;
-    virtual bool eventFilter(QObject* obj, QEvent* event) Q_DECL_OVERRIDE;
+    bool event(QEvent* event) override;
+    void showEvent(QShowEvent* event) override;
+    void hideEvent(QHideEvent* event) override;
+    void keyReleaseEvent(QKeyEvent* event) override;
+    bool eventFilter(QObject* obj, QEvent* event) override;
 
 signals:
     /**
@@ -122,7 +117,7 @@ signals:
      */
     void searchTextChanged(const QString& text);
 
-    void returnPressed(const QString& text);
+    void returnPressed();
 
     /**
      * Emitted as soon as the search box should get closed.
@@ -140,11 +135,11 @@ private slots:
     void emitSearchRequest();
     void emitCloseRequest();
     void slotConfigurationChanged();
-    void slotSearchTextChanged();
+    void slotSearchTextChanged(const QString& text);
     void slotReturnPressed();
     void slotFacetsButtonToggled();
     void slotFacetChanged();
-    void updateSearchInputParsing();
+    void slotSearchSaved();
 
 private:
     void initButton(QToolButton* button);
@@ -163,20 +158,19 @@ private:
      */
     void fromBalooSearchUrl(const QUrl& url);
 
+    void setFacetsVisible(bool visible);
     void updateFacetsToggleButton();
+
+    bool isIndexingEnabled() const;
+
 private:
     bool m_startedSearching;
     bool m_active;
 
     QVBoxLayout* m_topLayout;
 
-    QLabel* m_searchLabel;
-#ifdef HAVE_BALOO
-    Baloo::QueryBuilder* m_searchInput;
-    QScopedPointer<Baloo::NaturalQueryParser> m_queryParser;
-#else
     QLineEdit* m_searchInput;
-#endif
+    QAction* m_saveSearchAction;
     QScrollArea* m_optionsScrollArea;
     QToolButton* m_fileNameButton;
     QToolButton* m_contentButton;
@@ -187,6 +181,7 @@ private:
     DolphinFacetsWidget* m_facetsWidget;
 
     QUrl m_searchPath;
+    QScopedPointer<KMoreToolsMenuFactory> m_menuFactory;
 
     QTimer* m_startSearchTimer;
 };