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 QToolButton; | ||||
elvisangelaccio: Not needed | |||||
28 | 30 | | |||
29 | /** | 31 | /** | ||
30 | * @brief Allows to filter search-queries by facets. | 32 | * @brief Allows to filter search-queries by facets. | ||
elvisangelaccio: Not needed | |||||
31 | * | 33 | * | ||
32 | * TODO: The current implementation is a temporary | 34 | * TODO: The current implementation is a temporary | ||
33 | * workaround for the 4.9 release and represents no | 35 | * workaround for the 4.9 release and represents no | ||
34 | * real facets-implementation yet: There have been | 36 | * real facets-implementation yet: There have been | ||
35 | * some Dolphin specific user-interface and interaction | 37 | * some Dolphin specific user-interface and interaction | ||
36 | * issues since 4.6 by embedding the Nepomuk facet-widget | 38 | * issues since 4.6 by embedding the Nepomuk facet-widget | ||
37 | * into a QDockWidget (this is unrelated to the | 39 | * into a QDockWidget (this is unrelated to the | ||
38 | * Nepomuk facet-widget itself). Now in combination | 40 | * Nepomuk facet-widget itself). Now in combination | ||
Show All 22 Lines | 51 | public: | |||
61 | void setFacetType(const QString& type); | 63 | void setFacetType(const QString& type); | ||
62 | 64 | | |||
63 | signals: | 65 | signals: | ||
64 | void facetChanged(); | 66 | void facetChanged(); | ||
65 | 67 | | |||
66 | protected: | 68 | protected: | ||
67 | void changeEvent(QEvent* event) override; | 69 | void changeEvent(QEvent* event) override; | ||
68 | 70 | | |||
71 | private slots: | ||||
72 | void updateTagsMenu(); | ||||
73 | void updateTagsMenuItems(const QUrl&, const KFileItemList& items); | ||||
74 | | ||||
69 | private: | 75 | private: | ||
70 | void setRating(const int stars); | 76 | void setRating(const int stars); | ||
71 | void setTimespan(const QDate& date); | 77 | void setTimespan(const QDate& date); | ||
78 | void addSearchTag(const QString& tag); | ||||
79 | void removeSearchTag(const QString& tag); | ||||
80 | | ||||
72 | void initComboBox(QComboBox* combo); | 81 | void initComboBox(QComboBox* combo); | ||
82 | void updateTagsSelector(); | ||||
73 | 83 | | |||
74 | private: | 84 | private: | ||
75 | QComboBox* m_typeSelector; | 85 | QComboBox* m_typeSelector; | ||
76 | QComboBox* m_dateSelector; | 86 | QComboBox* m_dateSelector; | ||
77 | QComboBox* m_ratingSelector; | 87 | QComboBox* m_ratingSelector; | ||
88 | QToolButton* m_tagsSelector; | ||||
89 | | ||||
90 | QStringList m_searchTags; | ||||
elvisangelaccio: Initialization not needed, the defautl ctor is automatically called. | |||||
91 | KCoreDirLister m_tagsLister; | ||||
78 | }; | 92 | }; | ||
79 | 93 | | |||
80 | #endif | 94 | #endif |
Not needed