Changeset View
Changeset View
Standalone View
Standalone View
src/kstatusnotifieritem.cpp
Show All 14 Lines | 1 | /* This file is part of the KDE libraries | |||
---|---|---|---|---|---|
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License | ||
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to | ||
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 | 20 | | |||
21 | #include "kstatusnotifieritem.h" | 21 | #include "kstatusnotifieritem.h" | ||
22 | #include "kstatusnotifieritemprivate_p.h" | 22 | #include "kstatusnotifieritemprivate_p.h" | ||
23 | #include "kstatusnotifieritemdbus_p.h" | | |||
24 | #include "debug_p.h" | 23 | #include "debug_p.h" | ||
25 | 24 | | |||
26 | #include <QDBusConnection> | | |||
27 | #include <QMessageBox> | 25 | #include <QMessageBox> | ||
28 | #include <QPixmap> | 26 | #include <QPixmap> | ||
29 | #include <QImage> | 27 | #include <QImage> | ||
30 | #include <QApplication> | 28 | #include <QApplication> | ||
31 | #include <QMenu> | 29 | #include <QMenu> | ||
32 | #include <QMovie> | 30 | #include <QMovie> | ||
33 | #include <QPainter> | 31 | #include <QPainter> | ||
34 | #include <qstandardpaths.h> | 32 | #include <qstandardpaths.h> | ||
35 | #ifdef Q_OS_MACOS | 33 | #ifdef Q_OS_MACOS | ||
36 | #include <qfontdatabase.h> | 34 | #include <qfontdatabase.h> | ||
37 | #include <QtMac> | 35 | #include <QtMac> | ||
38 | #endif | 36 | #endif | ||
39 | 37 | | |||
38 | #ifdef QT_DBUS_LIB | ||||
39 | #include "kstatusnotifieritemdbus_p.h" | ||||
40 | | ||||
41 | #include <QDBusConnection> | ||||
42 | | ||||
43 | #if HAVE_DBUSMENUQT | ||||
44 | #include <dbusmenuexporter.h> | ||||
45 | #endif //HAVE_DBUSMENUQT | ||||
46 | #endif | ||||
47 | | ||||
48 | #include <QTimer> | ||||
bcooksley: New header? | |||||
40 | #include <kwindowinfo.h> | 49 | #include <kwindowinfo.h> | ||
41 | #include <kwindowsystem.h> | 50 | #include <kwindowsystem.h> | ||
42 | 51 | | |||
43 | #include <cstdlib> | 52 | #include <cstdlib> | ||
44 | 53 | | |||
45 | #include <config-knotifications.h> | 54 | #include <config-knotifications.h> | ||
46 | 55 | | |||
47 | static const char s_statusNotifierWatcherServiceName[] = "org.kde.StatusNotifierWatcher"; | 56 | static const char s_statusNotifierWatcherServiceName[] = "org.kde.StatusNotifierWatcher"; | ||
48 | static const int s_legacyTrayIconSize = 24; | 57 | static const int s_legacyTrayIconSize = 24; | ||
49 | 58 | | |||
50 | #if HAVE_DBUSMENUQT | | |||
51 | #include <dbusmenuexporter.h> | | |||
52 | #endif //HAVE_DBUSMENUQT | | |||
53 | | ||||
54 | KStatusNotifierItem::KStatusNotifierItem(QObject *parent) | 59 | KStatusNotifierItem::KStatusNotifierItem(QObject *parent) | ||
55 | : QObject(parent), | 60 | : QObject(parent), | ||
56 | d(new KStatusNotifierItemPrivate(this)) | 61 | d(new KStatusNotifierItemPrivate(this)) | ||
57 | { | 62 | { | ||
58 | d->init(QString()); | 63 | d->init(QString()); | ||
59 | } | 64 | } | ||
60 | 65 | | |||
61 | KStatusNotifierItem::KStatusNotifierItem(const QString &id, QObject *parent) | 66 | KStatusNotifierItem::KStatusNotifierItem(const QString &id, QObject *parent) | ||
62 | : QObject(parent), | 67 | : QObject(parent), | ||
63 | d(new KStatusNotifierItemPrivate(this)) | 68 | d(new KStatusNotifierItemPrivate(this)) | ||
64 | { | 69 | { | ||
65 | d->init(id); | 70 | d->init(id); | ||
66 | } | 71 | } | ||
67 | 72 | | |||
68 | KStatusNotifierItem::~KStatusNotifierItem() | 73 | KStatusNotifierItem::~KStatusNotifierItem() | ||
69 | { | 74 | { | ||
75 | #ifdef QT_DBUS_LIB | ||||
70 | delete d->statusNotifierWatcher; | 76 | delete d->statusNotifierWatcher; | ||
71 | delete d->notificationsClient; | 77 | delete d->notificationsClient; | ||
78 | #endif | ||||
72 | delete d->systemTrayIcon; | 79 | delete d->systemTrayIcon; | ||
73 | if (!qApp->closingDown()) { | 80 | if (!qApp->closingDown()) { | ||
74 | delete d->menu; | 81 | delete d->menu; | ||
75 | } | 82 | } | ||
76 | if (d->associatedWidget) { | 83 | if (d->associatedWidget) { | ||
77 | KWindowSystem::self()->disconnect(d->associatedWidget); | 84 | KWindowSystem::self()->disconnect(d->associatedWidget); | ||
78 | } | 85 | } | ||
79 | delete d; | 86 | delete d; | ||
Show All 27 Lines | |||||
107 | 114 | | |||
108 | void KStatusNotifierItem::setStatus(const ItemStatus status) | 115 | void KStatusNotifierItem::setStatus(const ItemStatus status) | ||
109 | { | 116 | { | ||
110 | if (d->status == status) { | 117 | if (d->status == status) { | ||
111 | return; | 118 | return; | ||
112 | } | 119 | } | ||
113 | 120 | | |||
114 | d->status = status; | 121 | d->status = status; | ||
115 | emit d->statusNotifierItemDBus->NewStatus(QString::fromLatin1(metaObject()->enumerator(metaObject()->indexOfEnumerator("ItemStatus")).valueToKey(d->status))); | | |||
116 | 122 | | |||
123 | #ifdef QT_DBUS_LIB | ||||
124 | emit d->statusNotifierItemDBus->NewStatus(QString::fromLatin1(metaObject()->enumerator(metaObject()->indexOfEnumerator("ItemStatus")).valueToKey(d->status))); | ||||
125 | #endif | ||||
117 | if (d->systemTrayIcon) { | 126 | if (d->systemTrayIcon) { | ||
118 | d->syncLegacySystemTrayIcon(); | 127 | d->syncLegacySystemTrayIcon(); | ||
119 | } | 128 | } | ||
120 | } | 129 | } | ||
121 | 130 | | |||
122 | //normal icon | 131 | //normal icon | ||
123 | 132 | | |||
124 | void KStatusNotifierItem::setIconByName(const QString &name) | 133 | void KStatusNotifierItem::setIconByName(const QString &name) | ||
125 | { | 134 | { | ||
126 | if (d->iconName == name) { | 135 | if (d->iconName == name) { | ||
127 | return; | 136 | return; | ||
128 | } | 137 | } | ||
129 | 138 | | |||
130 | d->serializedIcon = KDbusImageVector(); | 139 | | ||
131 | d->iconName = name; | 140 | d->iconName = name; | ||
141 | | ||||
142 | #ifdef QT_DBUS_LIB | ||||
143 | d->serializedIcon = KDbusImageVector(); | ||||
132 | emit d->statusNotifierItemDBus->NewIcon(); | 144 | emit d->statusNotifierItemDBus->NewIcon(); | ||
145 | #endif | ||||
146 | | ||||
133 | if (d->systemTrayIcon) { | 147 | if (d->systemTrayIcon) { | ||
134 | d->systemTrayIcon->setIcon(QIcon::fromTheme(name)); | 148 | d->systemTrayIcon->setIcon(QIcon::fromTheme(name)); | ||
135 | } | 149 | } | ||
136 | } | 150 | } | ||
137 | 151 | | |||
138 | QString KStatusNotifierItem::iconName() const | 152 | QString KStatusNotifierItem::iconName() const | ||
139 | { | 153 | { | ||
140 | return d->iconName; | 154 | return d->iconName; | ||
141 | } | 155 | } | ||
142 | 156 | | |||
143 | void KStatusNotifierItem::setIconByPixmap(const QIcon &icon) | 157 | void KStatusNotifierItem::setIconByPixmap(const QIcon &icon) | ||
144 | { | 158 | { | ||
145 | if (d->iconName.isEmpty() && d->icon.cacheKey() == icon.cacheKey()) { | 159 | if (d->iconName.isEmpty() && d->icon.cacheKey() == icon.cacheKey()) { | ||
146 | return; | 160 | return; | ||
147 | } | 161 | } | ||
148 | 162 | | |||
149 | d->iconName.clear(); | 163 | d->iconName.clear(); | ||
164 | | ||||
165 | #ifdef QT_DBUS_LIB | ||||
150 | d->serializedIcon = d->iconToVector(icon); | 166 | d->serializedIcon = d->iconToVector(icon); | ||
151 | emit d->statusNotifierItemDBus->NewIcon(); | 167 | emit d->statusNotifierItemDBus->NewIcon(); | ||
168 | #endif | ||||
152 | 169 | | |||
153 | d->icon = icon; | 170 | d->icon = icon; | ||
154 | if (d->systemTrayIcon) { | 171 | if (d->systemTrayIcon) { | ||
155 | d->systemTrayIcon->setIcon(icon); | 172 | d->systemTrayIcon->setIcon(icon); | ||
156 | } | 173 | } | ||
157 | } | 174 | } | ||
158 | 175 | | |||
159 | QIcon KStatusNotifierItem::iconPixmap() const | 176 | QIcon KStatusNotifierItem::iconPixmap() const | ||
160 | { | 177 | { | ||
161 | return d->icon; | 178 | return d->icon; | ||
162 | } | 179 | } | ||
163 | 180 | | |||
164 | void KStatusNotifierItem::setOverlayIconByName(const QString &name) | 181 | void KStatusNotifierItem::setOverlayIconByName(const QString &name) | ||
165 | { | 182 | { | ||
166 | if (d->overlayIconName == name) { | 183 | if (d->overlayIconName == name) { | ||
167 | return; | 184 | return; | ||
168 | } | 185 | } | ||
169 | 186 | | |||
170 | d->overlayIconName = name; | 187 | d->overlayIconName = name; | ||
188 | #ifdef QT_DBUS_LIB | ||||
171 | emit d->statusNotifierItemDBus->NewOverlayIcon(); | 189 | emit d->statusNotifierItemDBus->NewOverlayIcon(); | ||
190 | #endif | ||||
172 | if (d->systemTrayIcon) { | 191 | if (d->systemTrayIcon) { | ||
173 | QPixmap iconPixmap = QIcon::fromTheme(d->iconName).pixmap(s_legacyTrayIconSize, s_legacyTrayIconSize); | 192 | QPixmap iconPixmap = QIcon::fromTheme(d->iconName).pixmap(s_legacyTrayIconSize, s_legacyTrayIconSize); | ||
174 | if (!name.isEmpty()) { | 193 | if (!name.isEmpty()) { | ||
175 | QPixmap overlayPixmap = QIcon::fromTheme(d->overlayIconName).pixmap(s_legacyTrayIconSize / 2, s_legacyTrayIconSize / 2); | 194 | QPixmap overlayPixmap = QIcon::fromTheme(d->overlayIconName).pixmap(s_legacyTrayIconSize / 2, s_legacyTrayIconSize / 2); | ||
176 | QPainter p(&iconPixmap); | 195 | QPainter p(&iconPixmap); | ||
177 | p.drawPixmap(iconPixmap.width() - overlayPixmap.width(), iconPixmap.height() - overlayPixmap.height(), overlayPixmap); | 196 | p.drawPixmap(iconPixmap.width() - overlayPixmap.width(), iconPixmap.height() - overlayPixmap.height(), overlayPixmap); | ||
178 | p.end(); | 197 | p.end(); | ||
179 | } | 198 | } | ||
180 | d->systemTrayIcon->setIcon(iconPixmap); | 199 | d->systemTrayIcon->setIcon(iconPixmap); | ||
181 | } | 200 | } | ||
182 | } | 201 | } | ||
183 | 202 | | |||
184 | QString KStatusNotifierItem::overlayIconName() const | 203 | QString KStatusNotifierItem::overlayIconName() const | ||
185 | { | 204 | { | ||
186 | return d->overlayIconName; | 205 | return d->overlayIconName; | ||
187 | } | 206 | } | ||
188 | 207 | | |||
189 | void KStatusNotifierItem::setOverlayIconByPixmap(const QIcon &icon) | 208 | void KStatusNotifierItem::setOverlayIconByPixmap(const QIcon &icon) | ||
190 | { | 209 | { | ||
191 | if (d->overlayIconName.isEmpty() && d->overlayIcon.cacheKey() == icon.cacheKey()) { | 210 | if (d->overlayIconName.isEmpty() && d->overlayIcon.cacheKey() == icon.cacheKey()) { | ||
192 | return; | 211 | return; | ||
193 | } | 212 | } | ||
194 | 213 | | |||
195 | d->overlayIconName.clear(); | 214 | d->overlayIconName.clear(); | ||
215 | | ||||
216 | #ifdef QT_DBUS_LIB | ||||
196 | d->serializedOverlayIcon = d->iconToVector(icon); | 217 | d->serializedOverlayIcon = d->iconToVector(icon); | ||
197 | emit d->statusNotifierItemDBus->NewOverlayIcon(); | 218 | emit d->statusNotifierItemDBus->NewOverlayIcon(); | ||
219 | #endif | ||||
198 | 220 | | |||
199 | d->overlayIcon = icon; | 221 | d->overlayIcon = icon; | ||
200 | if (d->systemTrayIcon) { | 222 | if (d->systemTrayIcon) { | ||
201 | QPixmap iconPixmap = d->icon.pixmap(s_legacyTrayIconSize, s_legacyTrayIconSize); | 223 | QPixmap iconPixmap = d->icon.pixmap(s_legacyTrayIconSize, s_legacyTrayIconSize); | ||
202 | QPixmap overlayPixmap = d->overlayIcon.pixmap(s_legacyTrayIconSize / 2, s_legacyTrayIconSize / 2); | 224 | QPixmap overlayPixmap = d->overlayIcon.pixmap(s_legacyTrayIconSize / 2, s_legacyTrayIconSize / 2); | ||
203 | 225 | | |||
204 | QPainter p(&iconPixmap); | 226 | QPainter p(&iconPixmap); | ||
205 | p.drawPixmap(iconPixmap.width() - overlayPixmap.width(), iconPixmap.height() - overlayPixmap.height(), overlayPixmap); | 227 | p.drawPixmap(iconPixmap.width() - overlayPixmap.width(), iconPixmap.height() - overlayPixmap.height(), overlayPixmap); | ||
Show All 10 Lines | |||||
216 | //Icons and movie for requesting attention state | 238 | //Icons and movie for requesting attention state | ||
217 | 239 | | |||
218 | void KStatusNotifierItem::setAttentionIconByName(const QString &name) | 240 | void KStatusNotifierItem::setAttentionIconByName(const QString &name) | ||
219 | { | 241 | { | ||
220 | if (d->attentionIconName == name) { | 242 | if (d->attentionIconName == name) { | ||
221 | return; | 243 | return; | ||
222 | } | 244 | } | ||
223 | 245 | | |||
224 | d->serializedAttentionIcon = KDbusImageVector(); | | |||
225 | d->attentionIconName = name; | 246 | d->attentionIconName = name; | ||
247 | | ||||
248 | #ifdef QT_DBUS_LIB | ||||
249 | d->serializedAttentionIcon = KDbusImageVector(); | ||||
226 | emit d->statusNotifierItemDBus->NewAttentionIcon(); | 250 | emit d->statusNotifierItemDBus->NewAttentionIcon(); | ||
251 | #endif | ||||
227 | } | 252 | } | ||
228 | 253 | | |||
229 | QString KStatusNotifierItem::attentionIconName() const | 254 | QString KStatusNotifierItem::attentionIconName() const | ||
230 | { | 255 | { | ||
231 | return d->attentionIconName; | 256 | return d->attentionIconName; | ||
232 | } | 257 | } | ||
233 | 258 | | |||
234 | void KStatusNotifierItem::setAttentionIconByPixmap(const QIcon &icon) | 259 | void KStatusNotifierItem::setAttentionIconByPixmap(const QIcon &icon) | ||
235 | { | 260 | { | ||
236 | if (d->attentionIconName.isEmpty() && d->attentionIcon.cacheKey() == icon.cacheKey()) { | 261 | if (d->attentionIconName.isEmpty() && d->attentionIcon.cacheKey() == icon.cacheKey()) { | ||
237 | return; | 262 | return; | ||
238 | } | 263 | } | ||
239 | 264 | | |||
240 | d->attentionIconName.clear(); | 265 | d->attentionIconName.clear(); | ||
241 | d->serializedAttentionIcon = d->iconToVector(icon); | | |||
242 | d->attentionIcon = icon; | 266 | d->attentionIcon = icon; | ||
267 | | ||||
268 | #ifdef QT_DBUS_LIB | ||||
269 | d->serializedAttentionIcon = d->iconToVector(icon); | ||||
243 | emit d->statusNotifierItemDBus->NewAttentionIcon(); | 270 | emit d->statusNotifierItemDBus->NewAttentionIcon(); | ||
271 | #endif | ||||
244 | } | 272 | } | ||
245 | 273 | | |||
246 | QIcon KStatusNotifierItem::attentionIconPixmap() const | 274 | QIcon KStatusNotifierItem::attentionIconPixmap() const | ||
247 | { | 275 | { | ||
248 | return d->attentionIcon; | 276 | return d->attentionIcon; | ||
249 | } | 277 | } | ||
250 | 278 | | |||
251 | void KStatusNotifierItem::setAttentionMovieByName(const QString &name) | 279 | void KStatusNotifierItem::setAttentionMovieByName(const QString &name) | ||
252 | { | 280 | { | ||
253 | if (d->movieName == name) { | 281 | if (d->movieName == name) { | ||
254 | return; | 282 | return; | ||
255 | } | 283 | } | ||
256 | 284 | | |||
257 | d->movieName = name; | 285 | d->movieName = name; | ||
258 | 286 | | |||
259 | delete d->movie; | 287 | delete d->movie; | ||
260 | d->movie = nullptr; | 288 | d->movie = nullptr; | ||
261 | 289 | | |||
290 | #ifdef QT_DBUS_LIB | ||||
262 | emit d->statusNotifierItemDBus->NewAttentionIcon(); | 291 | emit d->statusNotifierItemDBus->NewAttentionIcon(); | ||
292 | #endif | ||||
263 | 293 | | |||
264 | if (d->systemTrayIcon) { | 294 | if (d->systemTrayIcon) { | ||
265 | d->movie = new QMovie(d->movieName); | 295 | d->movie = new QMovie(d->movieName); | ||
266 | d->systemTrayIcon->setMovie(d->movie); | 296 | d->systemTrayIcon->setMovie(d->movie); | ||
267 | } | 297 | } | ||
268 | } | 298 | } | ||
269 | 299 | | |||
270 | QString KStatusNotifierItem::attentionMovieName() const | 300 | QString KStatusNotifierItem::attentionMovieName() const | ||
Show All 36 Lines | |||||
307 | void KStatusNotifierItem::setToolTip(const QString &iconName, const QString &title, const QString &subTitle) | 337 | void KStatusNotifierItem::setToolTip(const QString &iconName, const QString &title, const QString &subTitle) | ||
308 | { | 338 | { | ||
309 | if (d->toolTipIconName == iconName && | 339 | if (d->toolTipIconName == iconName && | ||
310 | d->toolTipTitle == title && | 340 | d->toolTipTitle == title && | ||
311 | d->toolTipSubTitle == subTitle) { | 341 | d->toolTipSubTitle == subTitle) { | ||
312 | return; | 342 | return; | ||
313 | } | 343 | } | ||
314 | 344 | | |||
315 | d->serializedToolTipIcon = KDbusImageVector(); | | |||
316 | d->toolTipIconName = iconName; | 345 | d->toolTipIconName = iconName; | ||
317 | 346 | | |||
318 | d->toolTipTitle = title; | 347 | d->toolTipTitle = title; | ||
319 | // if (d->systemTrayIcon) { | 348 | // if (d->systemTrayIcon) { | ||
320 | // d->systemTrayIcon->setToolTip(title); | 349 | // d->systemTrayIcon->setToolTip(title); | ||
321 | // } | 350 | // } | ||
322 | setTrayToolTip(d->systemTrayIcon, title, subTitle); | 351 | setTrayToolTip(d->systemTrayIcon, title, subTitle); | ||
323 | d->toolTipSubTitle = subTitle; | 352 | d->toolTipSubTitle = subTitle; | ||
353 | | ||||
354 | #ifdef QT_DBUS_LIB | ||||
355 | d->serializedToolTipIcon = KDbusImageVector(); | ||||
324 | emit d->statusNotifierItemDBus->NewToolTip(); | 356 | emit d->statusNotifierItemDBus->NewToolTip(); | ||
357 | #endif | ||||
325 | } | 358 | } | ||
326 | 359 | | |||
327 | void KStatusNotifierItem::setToolTip(const QIcon &icon, const QString &title, const QString &subTitle) | 360 | void KStatusNotifierItem::setToolTip(const QIcon &icon, const QString &title, const QString &subTitle) | ||
328 | { | 361 | { | ||
329 | if (d->toolTipIconName.isEmpty() && d->toolTipIcon.cacheKey() == icon.cacheKey() && | 362 | if (d->toolTipIconName.isEmpty() && d->toolTipIcon.cacheKey() == icon.cacheKey() && | ||
330 | d->toolTipTitle == title && | 363 | d->toolTipTitle == title && | ||
331 | d->toolTipSubTitle == subTitle) { | 364 | d->toolTipSubTitle == subTitle) { | ||
332 | return; | 365 | return; | ||
333 | } | 366 | } | ||
334 | 367 | | |||
335 | d->toolTipIconName.clear(); | 368 | d->toolTipIconName.clear(); | ||
336 | d->serializedToolTipIcon = d->iconToVector(icon); | | |||
337 | d->toolTipIcon = icon; | 369 | d->toolTipIcon = icon; | ||
338 | 370 | | |||
339 | d->toolTipTitle = title; | 371 | d->toolTipTitle = title; | ||
340 | // if (d->systemTrayIcon) { | 372 | // if (d->systemTrayIcon) { | ||
341 | // d->systemTrayIcon->setToolTip(title); | 373 | // d->systemTrayIcon->setToolTip(title); | ||
342 | // } | 374 | // } | ||
343 | setTrayToolTip(d->systemTrayIcon, title, subTitle); | 375 | setTrayToolTip(d->systemTrayIcon, title, subTitle); | ||
344 | 376 | | |||
345 | d->toolTipSubTitle = subTitle; | 377 | d->toolTipSubTitle = subTitle; | ||
378 | #ifdef QT_DBUS_LIB | ||||
379 | d->serializedToolTipIcon = d->iconToVector(icon); | ||||
346 | emit d->statusNotifierItemDBus->NewToolTip(); | 380 | emit d->statusNotifierItemDBus->NewToolTip(); | ||
381 | #endif | ||||
347 | } | 382 | } | ||
348 | 383 | | |||
349 | void KStatusNotifierItem::setToolTipIconByName(const QString &name) | 384 | void KStatusNotifierItem::setToolTipIconByName(const QString &name) | ||
350 | { | 385 | { | ||
351 | if (d->toolTipIconName == name) { | 386 | if (d->toolTipIconName == name) { | ||
352 | return; | 387 | return; | ||
353 | } | 388 | } | ||
354 | 389 | | |||
355 | d->serializedToolTipIcon = KDbusImageVector(); | | |||
356 | d->toolTipIconName = name; | 390 | d->toolTipIconName = name; | ||
391 | #ifdef QT_DBUS_LIB | ||||
392 | d->serializedToolTipIcon = KDbusImageVector(); | ||||
357 | emit d->statusNotifierItemDBus->NewToolTip(); | 393 | emit d->statusNotifierItemDBus->NewToolTip(); | ||
394 | #endif | ||||
358 | } | 395 | } | ||
359 | 396 | | |||
360 | QString KStatusNotifierItem::toolTipIconName() const | 397 | QString KStatusNotifierItem::toolTipIconName() const | ||
361 | { | 398 | { | ||
362 | return d->toolTipIconName; | 399 | return d->toolTipIconName; | ||
363 | } | 400 | } | ||
364 | 401 | | |||
365 | void KStatusNotifierItem::setToolTipIconByPixmap(const QIcon &icon) | 402 | void KStatusNotifierItem::setToolTipIconByPixmap(const QIcon &icon) | ||
366 | { | 403 | { | ||
367 | if (d->toolTipIconName.isEmpty() && d->toolTipIcon.cacheKey() == icon.cacheKey()) { | 404 | if (d->toolTipIconName.isEmpty() && d->toolTipIcon.cacheKey() == icon.cacheKey()) { | ||
368 | return; | 405 | return; | ||
369 | } | 406 | } | ||
370 | 407 | | |||
371 | d->toolTipIconName.clear(); | 408 | d->toolTipIconName.clear(); | ||
372 | d->serializedToolTipIcon = d->iconToVector(icon); | | |||
373 | d->toolTipIcon = icon; | 409 | d->toolTipIcon = icon; | ||
410 | | ||||
411 | #ifdef QT_DBUS_LIB | ||||
412 | d->serializedToolTipIcon = d->iconToVector(icon); | ||||
374 | emit d->statusNotifierItemDBus->NewToolTip(); | 413 | emit d->statusNotifierItemDBus->NewToolTip(); | ||
414 | #endif | ||||
375 | } | 415 | } | ||
376 | 416 | | |||
377 | QIcon KStatusNotifierItem::toolTipIconPixmap() const | 417 | QIcon KStatusNotifierItem::toolTipIconPixmap() const | ||
378 | { | 418 | { | ||
379 | return d->toolTipIcon; | 419 | return d->toolTipIcon; | ||
380 | } | 420 | } | ||
381 | 421 | | |||
382 | void KStatusNotifierItem::setToolTipTitle(const QString &title) | 422 | void KStatusNotifierItem::setToolTipTitle(const QString &title) | ||
383 | { | 423 | { | ||
384 | if (d->toolTipTitle == title) { | 424 | if (d->toolTipTitle == title) { | ||
385 | return; | 425 | return; | ||
386 | } | 426 | } | ||
387 | 427 | | |||
388 | d->toolTipTitle = title; | 428 | d->toolTipTitle = title; | ||
429 | | ||||
430 | #ifdef QT_DBUS_LIB | ||||
389 | emit d->statusNotifierItemDBus->NewToolTip(); | 431 | emit d->statusNotifierItemDBus->NewToolTip(); | ||
432 | #endif | ||||
390 | // if (d->systemTrayIcon) { | 433 | // if (d->systemTrayIcon) { | ||
391 | // d->systemTrayIcon->setToolTip(title); | 434 | // d->systemTrayIcon->setToolTip(title); | ||
392 | // } | 435 | // } | ||
393 | setTrayToolTip(d->systemTrayIcon, title, d->toolTipSubTitle); | 436 | setTrayToolTip(d->systemTrayIcon, title, d->toolTipSubTitle); | ||
394 | } | 437 | } | ||
395 | 438 | | |||
396 | QString KStatusNotifierItem::toolTipTitle() const | 439 | QString KStatusNotifierItem::toolTipTitle() const | ||
397 | { | 440 | { | ||
398 | return d->toolTipTitle; | 441 | return d->toolTipTitle; | ||
399 | } | 442 | } | ||
400 | 443 | | |||
401 | void KStatusNotifierItem::setToolTipSubTitle(const QString &subTitle) | 444 | void KStatusNotifierItem::setToolTipSubTitle(const QString &subTitle) | ||
402 | { | 445 | { | ||
403 | if (d->toolTipSubTitle == subTitle) { | 446 | if (d->toolTipSubTitle == subTitle) { | ||
404 | return; | 447 | return; | ||
405 | } | 448 | } | ||
406 | 449 | | |||
407 | d->toolTipSubTitle = subTitle; | 450 | d->toolTipSubTitle = subTitle; | ||
408 | #ifdef Q_OS_MACOS | 451 | #ifdef Q_OS_MACOS | ||
409 | setTrayToolTip(d->systemTrayIcon, d->toolTipTitle, subTitle); | 452 | setTrayToolTip(d->systemTrayIcon, d->toolTipTitle, subTitle); | ||
410 | #endif | 453 | #endif | ||
454 | #ifdef QT_DBUS_LIB | ||||
411 | emit d->statusNotifierItemDBus->NewToolTip(); | 455 | emit d->statusNotifierItemDBus->NewToolTip(); | ||
456 | #endif | ||||
412 | } | 457 | } | ||
413 | 458 | | |||
414 | QString KStatusNotifierItem::toolTipSubTitle() const | 459 | QString KStatusNotifierItem::toolTipSubTitle() const | ||
415 | { | 460 | { | ||
416 | return d->toolTipSubTitle; | 461 | return d->toolTipSubTitle; | ||
417 | } | 462 | } | ||
418 | 463 | | |||
419 | void KStatusNotifierItem::setContextMenu(QMenu *menu) | 464 | void KStatusNotifierItem::setContextMenu(QMenu *menu) | ||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Line(s) | |||||
564 | } | 609 | } | ||
565 | 610 | | |||
566 | bool KStatusNotifierItem::standardActionsEnabled() const | 611 | bool KStatusNotifierItem::standardActionsEnabled() const | ||
567 | { | 612 | { | ||
568 | return d->standardActionsEnabled; | 613 | return d->standardActionsEnabled; | ||
569 | } | 614 | } | ||
570 | 615 | | |||
571 | void KStatusNotifierItem::showMessage(const QString &title, const QString &message, const QString &icon, int timeout) | 616 | void KStatusNotifierItem::showMessage(const QString &title, const QString &message, const QString &icon, int timeout) | ||
572 | { | 617 | { | ||
Won't this mean that showMessage() is a no-op on Windows systems without D-Bus? bcooksley: Won't this mean that showMessage() is a no-op on Windows systems without D-Bus?
I would have… | |||||
573 | if (!d->notificationsClient) { | | |||
574 | d->notificationsClient = new org::freedesktop::Notifications(QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("/org/freedesktop/Notifications"), | | |||
575 | QDBusConnection::sessionBus()); | | |||
576 | } | | |||
577 | | ||||
578 | uint id = 0; | | |||
579 | #ifdef Q_OS_MACOS | 618 | #ifdef Q_OS_MACOS | ||
580 | if (d->systemTrayIcon) { | 619 | if (d->systemTrayIcon) { | ||
581 | // Growl is not needed anymore for QSystemTrayIcon::showMessage() since OS X 10.8 | 620 | // Growl is not needed anymore for QSystemTrayIcon::showMessage() since OS X 10.8 | ||
582 | d->systemTrayIcon->showMessage(title, message, QSystemTrayIcon::Information, timeout); | 621 | d->systemTrayIcon->showMessage(title, message, QSystemTrayIcon::Information, timeout); | ||
583 | } else | 622 | } else | ||
584 | #endif | 623 | #endif | ||
585 | { | 624 | { | ||
625 | #ifdef QT_DBUS_LIB | ||||
626 | if (!d->notificationsClient) { | ||||
627 | d->notificationsClient = new org::freedesktop::Notifications(QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("/org/freedesktop/Notifications"), | ||||
628 | QDBusConnection::sessionBus()); | ||||
629 | } | ||||
630 | | ||||
631 | uint id = 0; | ||||
586 | QVariantMap hints; | 632 | QVariantMap hints; | ||
587 | 633 | | |||
588 | QString desktopFileName = QGuiApplication::desktopFileName(); | 634 | QString desktopFileName = QGuiApplication::desktopFileName(); | ||
589 | if (!desktopFileName.isEmpty()) { | 635 | if (!desktopFileName.isEmpty()) { | ||
590 | // handle apps which set the desktopFileName property with filename suffix, | 636 | // handle apps which set the desktopFileName property with filename suffix, | ||
591 | // due to unclear API dox (https://bugreports.qt.io/browse/QTBUG-75521) | 637 | // due to unclear API dox (https://bugreports.qt.io/browse/QTBUG-75521) | ||
592 | if (desktopFileName.endsWith(QLatin1String(".desktop"))) { | 638 | if (desktopFileName.endsWith(QLatin1String(".desktop"))) { | ||
593 | desktopFileName.chop(8); | 639 | desktopFileName.chop(8); | ||
594 | } | 640 | } | ||
595 | hints.insert(QStringLiteral("desktop-entry"), desktopFileName); | 641 | hints.insert(QStringLiteral("desktop-entry"), desktopFileName); | ||
596 | } | 642 | } | ||
597 | 643 | | |||
598 | d->notificationsClient->Notify(d->title, id, icon, title, message, QStringList(), hints, timeout); | 644 | d->notificationsClient->Notify(d->title, id, icon, title, message, QStringList(), hints, timeout); | ||
645 | #endif | ||||
599 | } | 646 | } | ||
600 | } | 647 | } | ||
601 | 648 | | |||
602 | QString KStatusNotifierItem::title() const | 649 | QString KStatusNotifierItem::title() const | ||
603 | { | 650 | { | ||
604 | return d->title; | 651 | return d->title; | ||
605 | } | 652 | } | ||
606 | 653 | | |||
607 | void KStatusNotifierItem::activate(const QPoint &pos) | 654 | void KStatusNotifierItem::activate(const QPoint &pos) | ||
608 | { | 655 | { | ||
609 | //if the user activated the icon the NeedsAttention state is no longer necessary | 656 | //if the user activated the icon the NeedsAttention state is no longer necessary | ||
610 | //FIXME: always true? | 657 | //FIXME: always true? | ||
611 | if (d->status == NeedsAttention) { | 658 | if (d->status == NeedsAttention) { | ||
612 | d->status = Active; | 659 | d->status = Active; | ||
613 | #ifdef Q_OS_MACOS | 660 | #ifdef Q_OS_MACOS | ||
614 | QtMac::setBadgeLabelText(QString()); | 661 | QtMac::setBadgeLabelText(QString()); | ||
615 | #endif | 662 | #endif | ||
663 | #ifdef QT_DBUS_LIB | ||||
616 | emit d->statusNotifierItemDBus->NewStatus(QString::fromLatin1(metaObject()->enumerator(metaObject()->indexOfEnumerator("ItemStatus")).valueToKey(d->status))); | 664 | emit d->statusNotifierItemDBus->NewStatus(QString::fromLatin1(metaObject()->enumerator(metaObject()->indexOfEnumerator("ItemStatus")).valueToKey(d->status))); | ||
665 | #endif | ||||
617 | } | 666 | } | ||
618 | 667 | | |||
668 | #ifdef QT_DBUS_LIB | ||||
619 | if (d->associatedWidget && d->associatedWidget == d->menu) { | 669 | if (d->associatedWidget && d->associatedWidget == d->menu) { | ||
620 | d->statusNotifierItemDBus->ContextMenu(pos.x(), pos.y()); | 670 | d->statusNotifierItemDBus->ContextMenu(pos.x(), pos.y()); | ||
621 | return; | 671 | return; | ||
622 | } | 672 | } | ||
673 | #endif | ||||
623 | 674 | | |||
624 | if (d->menu && d->menu->isVisible()) { | 675 | if (d->menu && d->menu->isVisible()) { | ||
625 | d->menu->hide(); | 676 | d->menu->hide(); | ||
626 | } | 677 | } | ||
627 | 678 | | |||
628 | if (!d->associatedWidget) { | 679 | if (!d->associatedWidget) { | ||
629 | emit activateRequested(true, pos); | 680 | emit activateRequested(true, pos); | ||
630 | return; | 681 | return; | ||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Line(s) | |||||
754 | KStatusNotifierItemPrivate::KStatusNotifierItemPrivate(KStatusNotifierItem *item) | 805 | KStatusNotifierItemPrivate::KStatusNotifierItemPrivate(KStatusNotifierItem *item) | ||
755 | : q(item), | 806 | : q(item), | ||
756 | category(KStatusNotifierItem::ApplicationStatus), | 807 | category(KStatusNotifierItem::ApplicationStatus), | ||
757 | status(KStatusNotifierItem::Passive), | 808 | status(KStatusNotifierItem::Passive), | ||
758 | movie(nullptr), | 809 | movie(nullptr), | ||
759 | menu(nullptr), | 810 | menu(nullptr), | ||
760 | associatedWidget(nullptr), | 811 | associatedWidget(nullptr), | ||
761 | titleAction(nullptr), | 812 | titleAction(nullptr), | ||
762 | statusNotifierWatcher(nullptr), | | |||
763 | notificationsClient(nullptr), | | |||
764 | systemTrayIcon(nullptr), | 813 | systemTrayIcon(nullptr), | ||
765 | hasQuit(false), | 814 | hasQuit(false), | ||
766 | onAllDesktops(false), | 815 | onAllDesktops(false), | ||
767 | standardActionsEnabled(true) | 816 | standardActionsEnabled(true) | ||
768 | { | 817 | { | ||
769 | } | 818 | } | ||
770 | 819 | | |||
771 | void KStatusNotifierItemPrivate::init(const QString &extraId) | 820 | void KStatusNotifierItemPrivate::init(const QString &extraId) | ||
772 | { | 821 | { | ||
822 | q->setAssociatedWidget(qobject_cast<QWidget *>(q->parent())); | ||||
823 | #ifdef QT_DBUS_LIB | ||||
773 | qDBusRegisterMetaType<KDbusImageStruct>(); | 824 | qDBusRegisterMetaType<KDbusImageStruct>(); | ||
774 | qDBusRegisterMetaType<KDbusImageVector>(); | 825 | qDBusRegisterMetaType<KDbusImageVector>(); | ||
775 | qDBusRegisterMetaType<KDbusToolTipStruct>(); | 826 | qDBusRegisterMetaType<KDbusToolTipStruct>(); | ||
776 | 827 | | |||
777 | statusNotifierItemDBus = new KStatusNotifierItemDBus(q); | 828 | statusNotifierItemDBus = new KStatusNotifierItemDBus(q); | ||
778 | q->setAssociatedWidget(qobject_cast<QWidget *>(q->parent())); | | |||
779 | 829 | | |||
780 | QDBusServiceWatcher *watcher = new QDBusServiceWatcher(QString::fromLatin1(s_statusNotifierWatcherServiceName), | 830 | QDBusServiceWatcher *watcher = new QDBusServiceWatcher(QString::fromLatin1(s_statusNotifierWatcherServiceName), | ||
781 | QDBusConnection::sessionBus(), | 831 | QDBusConnection::sessionBus(), | ||
782 | QDBusServiceWatcher::WatchForOwnerChange, | 832 | QDBusServiceWatcher::WatchForOwnerChange, | ||
783 | q); | 833 | q); | ||
784 | QObject::connect(watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)), | 834 | QObject::connect(watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)), | ||
785 | q, SLOT(serviceChange(QString,QString,QString))); | 835 | q, SLOT(serviceChange(QString,QString,QString))); | ||
836 | #endif | ||||
786 | 837 | | |||
787 | //create a default menu, just like in KSystemtrayIcon | 838 | //create a default menu, just like in KSystemtrayIcon | ||
788 | QMenu *m = new QMenu(associatedWidget); | 839 | QMenu *m = new QMenu(associatedWidget); | ||
789 | 840 | | |||
790 | title = QGuiApplication::applicationDisplayName(); | 841 | title = QGuiApplication::applicationDisplayName(); | ||
791 | if (title.isEmpty()) { | 842 | if (title.isEmpty()) { | ||
792 | title = QCoreApplication::applicationName(); | 843 | title = QCoreApplication::applicationName(); | ||
793 | } | 844 | } | ||
Show All 35 Lines | 862 | #endif | |||
829 | // Init iconThemePath to the app folder for now | 880 | // Init iconThemePath to the app folder for now | ||
830 | iconThemePath = QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("icons"), QStandardPaths::LocateDirectory); | 881 | iconThemePath = QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("icons"), QStandardPaths::LocateDirectory); | ||
831 | 882 | | |||
832 | registerToDaemon(); | 883 | registerToDaemon(); | ||
833 | } | 884 | } | ||
834 | 885 | | |||
835 | void KStatusNotifierItemPrivate::registerToDaemon() | 886 | void KStatusNotifierItemPrivate::registerToDaemon() | ||
836 | { | 887 | { | ||
888 | bool useLegacy = false; | ||||
From my reading of the setLegacySystemTrayEnabled() won't setting it to false explicitly disable any form of system tray icon? bcooksley: From my reading of the setLegacySystemTrayEnabled() won't setting it to false explicitly… | |||||
889 | #ifdef QT_DBUS_LIB | ||||
837 | qCDebug(LOG_KNOTIFICATIONS) << "Registering a client interface to the KStatusNotifierWatcher"; | 890 | qCDebug(LOG_KNOTIFICATIONS) << "Registering a client interface to the KStatusNotifierWatcher"; | ||
838 | if (!statusNotifierWatcher) { | 891 | if (!statusNotifierWatcher) { | ||
839 | statusNotifierWatcher = new org::kde::StatusNotifierWatcher(QString::fromLatin1(s_statusNotifierWatcherServiceName), QStringLiteral("/StatusNotifierWatcher"), | 892 | statusNotifierWatcher = new org::kde::StatusNotifierWatcher(QString::fromLatin1(s_statusNotifierWatcherServiceName), QStringLiteral("/StatusNotifierWatcher"), | ||
840 | QDBusConnection::sessionBus()); | 893 | QDBusConnection::sessionBus()); | ||
841 | } | 894 | } | ||
842 | 895 | | |||
843 | if (statusNotifierWatcher->isValid()) { | 896 | if (statusNotifierWatcher->isValid()) { | ||
844 | // get protocol version in async way | 897 | // get protocol version in async way | ||
Show All 21 Lines | 918 | } else { | |||
866 | qCDebug(LOG_KNOTIFICATIONS) << "KStatusNotifierWatcher has incorrect protocol version"; | 919 | qCDebug(LOG_KNOTIFICATIONS) << "KStatusNotifierWatcher has incorrect protocol version"; | ||
867 | setLegacySystemTrayEnabled(true); | 920 | setLegacySystemTrayEnabled(true); | ||
868 | } | 921 | } | ||
869 | } | 922 | } | ||
870 | } | 923 | } | ||
871 | ); | 924 | ); | ||
872 | } else { | 925 | } else { | ||
873 | qCDebug(LOG_KNOTIFICATIONS) << "KStatusNotifierWatcher not reachable"; | 926 | qCDebug(LOG_KNOTIFICATIONS) << "KStatusNotifierWatcher not reachable"; | ||
874 | setLegacySystemTrayEnabled(true); | 927 | useLegacy = true; | ||
875 | } | 928 | } | ||
929 | #endif | ||||
930 | setLegacySystemTrayEnabled(useLegacy); | ||||
876 | } | 931 | } | ||
877 | 932 | | |||
878 | void KStatusNotifierItemPrivate::serviceChange(const QString &name, const QString &oldOwner, const QString &newOwner) | 933 | void KStatusNotifierItemPrivate::serviceChange(const QString &name, const QString &oldOwner, const QString &newOwner) | ||
879 | { | 934 | { | ||
880 | Q_UNUSED(name) | 935 | Q_UNUSED(name) | ||
881 | if (newOwner.isEmpty()) { | 936 | if (newOwner.isEmpty()) { | ||
882 | //unregistered | 937 | //unregistered | ||
883 | qCDebug(LOG_KNOTIFICATIONS) << "Connection to the KStatusNotifierWatcher lost"; | 938 | qCDebug(LOG_KNOTIFICATIONS) << "Connection to the KStatusNotifierWatcher lost"; | ||
884 | setLegacyMode(true); | 939 | setLegacyMode(true); | ||
940 | #ifdef QT_DBUS_LIB | ||||
885 | delete statusNotifierWatcher; | 941 | delete statusNotifierWatcher; | ||
886 | statusNotifierWatcher = nullptr; | 942 | statusNotifierWatcher = nullptr; | ||
943 | #endif | ||||
887 | } else if (oldOwner.isEmpty()) { | 944 | } else if (oldOwner.isEmpty()) { | ||
888 | //registered | 945 | //registered | ||
889 | setLegacyMode(false); | 946 | setLegacyMode(false); | ||
890 | } | 947 | } | ||
891 | } | 948 | } | ||
892 | 949 | | |||
893 | void KStatusNotifierItemPrivate::setLegacyMode(bool legacy) | 950 | void KStatusNotifierItemPrivate::setLegacyMode(bool legacy) | ||
894 | { | 951 | { | ||
895 | if (legacy) { | 952 | if (legacy) { | ||
896 | //unregistered | 953 | //unregistered | ||
897 | setLegacySystemTrayEnabled(true); | 954 | setLegacySystemTrayEnabled(true); | ||
898 | } else { | 955 | } else { | ||
899 | //registered | 956 | //registered | ||
900 | registerToDaemon(); | 957 | registerToDaemon(); | ||
901 | } | 958 | } | ||
902 | } | 959 | } | ||
903 | 960 | | |||
904 | void KStatusNotifierItemPrivate::legacyWheelEvent(int delta) | 961 | void KStatusNotifierItemPrivate::legacyWheelEvent(int delta) | ||
905 | { | 962 | { | ||
963 | #ifdef QT_DBUS_LIB | ||||
906 | statusNotifierItemDBus->Scroll(delta, QStringLiteral("vertical")); | 964 | statusNotifierItemDBus->Scroll(delta, QStringLiteral("vertical")); | ||
965 | #endif | ||||
907 | } | 966 | } | ||
908 | 967 | | |||
909 | void KStatusNotifierItemPrivate::legacyActivated(QSystemTrayIcon::ActivationReason reason) | 968 | void KStatusNotifierItemPrivate::legacyActivated(QSystemTrayIcon::ActivationReason reason) | ||
910 | { | 969 | { | ||
911 | if (reason == QSystemTrayIcon::MiddleClick) { | 970 | if (reason == QSystemTrayIcon::MiddleClick) { | ||
912 | emit q->secondaryActivateRequested(systemTrayIcon->geometry().topLeft()); | 971 | emit q->secondaryActivateRequested(systemTrayIcon->geometry().topLeft()); | ||
913 | } else if (reason == QSystemTrayIcon::Trigger) { | 972 | } else if (reason == QSystemTrayIcon::Trigger) { | ||
914 | q->activate(systemTrayIcon->geometry().topLeft()); | 973 | q->activate(systemTrayIcon->geometry().topLeft()); | ||
▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Line(s) | 1159 | if (show) { | |||
1109 | associatedWidget->show(); | 1168 | associatedWidget->show(); | ||
1110 | associatedWidget->raise(); | 1169 | associatedWidget->raise(); | ||
1111 | } else { | 1170 | } else { | ||
1112 | onAllDesktops = info.onAllDesktops(); | 1171 | onAllDesktops = info.onAllDesktops(); | ||
1113 | associatedWidget->hide(); | 1172 | associatedWidget->hide(); | ||
1114 | } | 1173 | } | ||
1115 | } | 1174 | } | ||
1116 | 1175 | | |||
1176 | #ifdef QT_DBUS_LIB | ||||
1117 | KDbusImageStruct KStatusNotifierItemPrivate::imageToStruct(const QImage &image) | 1177 | KDbusImageStruct KStatusNotifierItemPrivate::imageToStruct(const QImage &image) | ||
1118 | { | 1178 | { | ||
1119 | KDbusImageStruct icon; | 1179 | KDbusImageStruct icon; | ||
1120 | icon.width = image.size().width(); | 1180 | icon.width = image.size().width(); | ||
1121 | icon.height = image.size().height(); | 1181 | icon.height = image.size().height(); | ||
1122 | if (image.format() == QImage::Format_ARGB32) { | 1182 | if (image.format() == QImage::Format_ARGB32) { | ||
1123 | icon.data = QByteArray((char *)image.bits(), image.sizeInBytes()); | 1183 | icon.data = QByteArray((char *)image.bits(), image.sizeInBytes()); | ||
1124 | } else { | 1184 | } else { | ||
Show All 23 Lines | 1202 | { | |||
1148 | const auto lstSizes = icon.availableSizes(); | 1208 | const auto lstSizes = icon.availableSizes(); | ||
1149 | for (QSize size : lstSizes) { | 1209 | for (QSize size : lstSizes) { | ||
1150 | iconPixmap = icon.pixmap(size); | 1210 | iconPixmap = icon.pixmap(size); | ||
1151 | iconVector.append(imageToStruct(iconPixmap.toImage())); | 1211 | iconVector.append(imageToStruct(iconPixmap.toImage())); | ||
1152 | } | 1212 | } | ||
1153 | 1213 | | |||
1154 | return iconVector; | 1214 | return iconVector; | ||
1155 | } | 1215 | } | ||
1216 | #endif | ||||
1156 | 1217 | | |||
1157 | #include "moc_kstatusnotifieritem.cpp" | 1218 | #include "moc_kstatusnotifieritem.cpp" | ||
1158 | #include "moc_kstatusnotifieritemprivate_p.cpp" | 1219 | #include "moc_kstatusnotifieritemprivate_p.cpp" |
New header?