Changeset View
Changeset View
Standalone View
Standalone View
src/platformtheme/kdeplatformsystemtrayicon.h
Show All 16 Lines | |||||
17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | * Boston, MA 02110-1301, USA. | 18 | * Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | #ifndef KDEPLATFORMSYSTEMTRAYICON_H | 20 | #ifndef KDEPLATFORMSYSTEMTRAYICON_H | ||
21 | #define KDEPLATFORMSYSTEMTRAYICON_H | 21 | #define KDEPLATFORMSYSTEMTRAYICON_H | ||
22 | 22 | | |||
23 | #include <qpa/qplatformmenu.h> | 23 | #include <qpa/qplatformmenu.h> | ||
24 | #include <qpa/qplatformsystemtrayicon.h> | 24 | #include <qpa/qplatformsystemtrayicon.h> | ||
25 | #include <QVariant> | ||||
25 | 26 | | |||
26 | class KStatusNotifierItem; | 27 | class KStatusNotifierItem; | ||
27 | class SystemTrayMenuItem; | 28 | class SystemTrayMenuItem; | ||
28 | class QAction; | 29 | class QAction; | ||
29 | class QMenu; | 30 | class QMenu; | ||
30 | 31 | | |||
31 | class SystemTrayMenu : public QPlatformMenu | 32 | class SystemTrayMenu : public QPlatformMenu | ||
32 | { | 33 | { | ||
Show All 18 Lines | 35 | public: | |||
51 | 52 | | |||
52 | QMenu *menu(); | 53 | QMenu *menu(); | ||
53 | 54 | | |||
54 | private: | 55 | private: | ||
55 | void createMenu(); | 56 | void createMenu(); | ||
56 | 57 | | |||
57 | QString m_text; | 58 | QString m_text; | ||
58 | QIcon m_icon; | 59 | QIcon m_icon; | ||
59 | bool m_enabled; | 60 | QVariant m_enabled; | ||
60 | bool m_visible; | 61 | QVariant m_visible; | ||
61 | bool m_separatorsCollapsible; | 62 | QVariant m_separatorsCollapsible; | ||
broulik: (This looks like a job for `std::optional`?) | |||||
Exactly! But I checked the code of KDE and it is never used. There are even some custom implementations (optional_view, 3 duplicates). QVariant was the closest thing available. BTW, is KDE officially using C++17? kmaterka: Exactly! But I checked the code of KDE and it is never used. There are even some custom… | |||||
62 | quintptr m_tag; | 63 | quintptr m_tag; | ||
63 | QPointer<QMenu> m_menu; | 64 | QPointer<QMenu> m_menu; | ||
64 | QList<SystemTrayMenuItem*> m_items; | 65 | QList<SystemTrayMenuItem*> m_items; | ||
65 | }; | 66 | }; | ||
66 | 67 | | |||
67 | class SystemTrayMenuItem : public QPlatformMenuItem | 68 | class SystemTrayMenuItem : public QPlatformMenuItem | ||
68 | { | 69 | { | ||
69 | Q_OBJECT | 70 | Q_OBJECT | ||
▲ Show 20 Lines • Show All 51 Lines • Show Last 20 Lines |
(This looks like a job for std::optional?)