Changeset View
Changeset View
Standalone View
Standalone View
src/search/dolphinfacetswidget.h
Show All 15 Lines | |||||
16 | * Free Software Foundation, Inc., * | 16 | * Free Software Foundation, Inc., * | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * | ||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | #ifndef DOLPHINFACETSWIDGET_H | 20 | #ifndef DOLPHINFACETSWIDGET_H | ||
21 | #define DOLPHINFACETSWIDGET_H | 21 | #define DOLPHINFACETSWIDGET_H | ||
22 | 22 | | |||
23 | #include <QWidget> | 23 | #include <QWidget> | ||
24 | #include <KCoreDirLister> | ||||
24 | 25 | | |||
25 | class QComboBox; | 26 | class QComboBox; | ||
26 | class QDate; | 27 | class QDate; | ||
27 | class QEvent; | 28 | class QEvent; | ||
29 | class QStringList; | ||||
elvisangelaccio: Not needed | |||||
30 | class QToolButton; | ||||
31 | | ||||
32 | class KFileItemList; | ||||
elvisangelaccio: Not needed | |||||
28 | 33 | | |||
29 | /** | 34 | /** | ||
30 | * @brief Allows to filter search-queries by facets. | 35 | * @brief Allows to filter search-queries by facets. | ||
31 | * | 36 | * | ||
32 | * TODO: The current implementation is a temporary | 37 | * TODO: The current implementation is a temporary | ||
33 | * workaround for the 4.9 release and represents no | 38 | * workaround for the 4.9 release and represents no | ||
34 | * real facets-implementation yet: There have been | 39 | * real facets-implementation yet: There have been | ||
35 | * some Dolphin specific user-interface and interaction | 40 | * some Dolphin specific user-interface and interaction | ||
Show All 25 Lines | 54 | public: | |||
61 | void setFacetType(const QString& type); | 66 | void setFacetType(const QString& type); | ||
62 | 67 | | |||
63 | signals: | 68 | signals: | ||
64 | void facetChanged(); | 69 | void facetChanged(); | ||
65 | 70 | | |||
66 | protected: | 71 | protected: | ||
67 | void changeEvent(QEvent* event) override; | 72 | void changeEvent(QEvent* event) override; | ||
68 | 73 | | |||
74 | private slots: | ||||
75 | void updateTagsMenu(); | ||||
76 | void updateTagsMenuItems(const QUrl&, const KFileItemList& items); | ||||
77 | | ||||
69 | private: | 78 | private: | ||
70 | void setRating(const int stars); | 79 | void setRating(const int stars); | ||
71 | void setTimespan(const QDate& date); | 80 | void setTimespan(const QDate& date); | ||
81 | void addSearchTag(const QString& tag); | ||||
82 | void removeSearchTag(const QString& tag); | ||||
83 | | ||||
72 | void initComboBox(QComboBox* combo); | 84 | void initComboBox(QComboBox* combo); | ||
85 | void updateTagsSelector(); | ||||
73 | 86 | | |||
74 | private: | 87 | private: | ||
75 | QComboBox* m_typeSelector; | 88 | QComboBox* m_typeSelector; | ||
76 | QComboBox* m_dateSelector; | 89 | QComboBox* m_dateSelector; | ||
77 | QComboBox* m_ratingSelector; | 90 | QComboBox* m_ratingSelector; | ||
91 | QToolButton* m_tagsSelector; | ||||
92 | | ||||
93 | QStringList m_searchTags = {}; | ||||
elvisangelaccio: Initialization not needed, the defautl ctor is automatically called. | |||||
94 | KCoreDirLister m_tagsLister; | ||||
78 | }; | 95 | }; | ||
79 | 96 | | |||
80 | #endif | 97 | #endif |
Not needed