Changeset View
Standalone View
src/kstatusnotifieritemprivate_p.h
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Line(s) | 105 | public: | |||
---|---|---|---|---|---|
150 | QString toolTipIconName; | 150 | QString toolTipIconName; | ||
151 | KDbusImageVector serializedToolTipIcon; | 151 | KDbusImageVector serializedToolTipIcon; | ||
152 | QIcon toolTipIcon; | 152 | QIcon toolTipIcon; | ||
153 | QString toolTipTitle; | 153 | QString toolTipTitle; | ||
154 | QString toolTipSubTitle; | 154 | QString toolTipSubTitle; | ||
155 | QString iconThemePath; | 155 | QString iconThemePath; | ||
156 | QString menuObjectPath; | 156 | QString menuObjectPath; | ||
157 | 157 | | |||
158 | QMenu *menu; | 158 | QPointer<QMenu> menu; | ||
anthonyfieroni: It should be QPointer<QMenu>, no other changes are needed. | |||||
Sure, but this is not my code and this is not related. What I want to do here is more like hack/workaround, so it is better to keep it as simple as possible. kmaterka: Sure, but this is not my code and this is not related. What I want to do here is more like… | |||||
It's related and you don't need to any hacks here. QPointer takes care of ownership. anthonyfieroni: It's related and you don't need to any hacks here. QPointer takes care of ownership. | |||||
QPointer here won't solve the other hacks needed. We have MenuSource, Menu and KSNI QPointer would fix the case of MenuSource still owning the Menu and KSNI lasting longer than the Menu. But we need things the other way round. We have MenuSource lasting longer than KSNI we need to supply a menu to the KSNI but keep the menu after the KSNI is deleted. QPointer won't solve that. (might be worth switching this to a QPointer anyway, now that ksni doesn't control the menu lifespan though) davidedmundson: QPointer here won't solve the other hacks needed.
We have MenuSource, Menu and KSNI
QPointer… | |||||
I will wrap m_menu in QPointer. When mane "ownership" is outside of the KSNI this is a valid case when menu is deleted before KSNI. That's a good practice anyway. kmaterka: I will wrap m_menu in QPointer. When mane "ownership" is outside of the KSNI this is a valid… | |||||
159 | QHash<QString, QAction *> actionCollection; | 159 | QHash<QString, QAction *> actionCollection; | ||
160 | QWidget *associatedWidget; | 160 | QWidget *associatedWidget; | ||
161 | QPoint associatedWidgetPos; | 161 | QPoint associatedWidgetPos; | ||
162 | QAction *titleAction; | 162 | QAction *titleAction; | ||
163 | org::kde::StatusNotifierWatcher *statusNotifierWatcher; | 163 | org::kde::StatusNotifierWatcher *statusNotifierWatcher; | ||
164 | org::freedesktop::Notifications *notificationsClient; | 164 | org::freedesktop::Notifications *notificationsClient; | ||
165 | 165 | | |||
166 | KStatusNotifierLegacyIcon *systemTrayIcon; | 166 | KStatusNotifierLegacyIcon *systemTrayIcon; | ||
167 | KStatusNotifierItemDBus *statusNotifierItemDBus; | 167 | KStatusNotifierItemDBus *statusNotifierItemDBus; | ||
168 | 168 | | |||
169 | // Ensure that closing the last KMainWindow doesn't exit the application | 169 | // Ensure that closing the last KMainWindow doesn't exit the application | ||
170 | // if a system tray icon is still present. | 170 | // if a system tray icon is still present. | ||
171 | QEventLoopLocker eventLoopLocker; | 171 | QEventLoopLocker eventLoopLocker; | ||
172 | 172 | | |||
173 | bool hasQuit : 1; | 173 | bool hasQuit : 1; | ||
174 | bool onAllDesktops : 1; | 174 | bool onAllDesktops : 1; | ||
175 | bool standardActionsEnabled : 1; | 175 | bool standardActionsEnabled : 1; | ||
176 | bool menuOwnership : 1; | ||||
176 | }; | 177 | }; | ||
177 | 178 | | |||
178 | #endif | 179 | #endif |
It should be QPointer<QMenu>, no other changes are needed.