@@ -39,7 +39,7 @@ Notificator::Notificator(const QString &_programName, QSystemTrayIcon *_trayIcon
39
39
mode(None),
40
40
trayIcon(_trayIcon)
41
41
#ifdef USE_DBUS
42
- ,interface(0 )
42
+ ,interface(nullptr )
43
43
#endif
44
44
{
45
45
if (_trayIcon && _trayIcon->supportsMessages ())
@@ -154,14 +154,14 @@ QVariant FreedesktopImage::toVariant(const QImage &img)
154
154
155
155
void Notificator::notifyDBus (Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout)
156
156
{
157
- Q_UNUSED (cls);
158
- // Arguments for DBus call:
157
+ // https://developer.gnome.org/notification-spec/
158
+ // Arguments for DBus "Notify" call:
159
159
QList<QVariant> args;
160
160
161
161
// Program Name:
162
162
args.append (programName);
163
163
164
- // Unique ID of this notification type :
164
+ // Replaces ID; A value of 0 means that this notification won't replace any existing notifications :
165
165
args.append (0U );
166
166
167
167
// Application Icon, empty string
@@ -209,9 +209,8 @@ void Notificator::notifyDBus(Class cls, const QString &title, const QString &tex
209
209
}
210
210
#endif
211
211
212
- void Notificator::notifySystray (Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout)
212
+ void Notificator::notifySystray (Class cls, const QString &title, const QString &text, int millisTimeout)
213
213
{
214
- Q_UNUSED (icon);
215
214
QSystemTrayIcon::MessageIcon sicon = QSystemTrayIcon::NoIcon;
216
215
switch (cls) // Set icon based on class
217
216
{
@@ -222,13 +221,12 @@ void Notificator::notifySystray(Class cls, const QString &title, const QString &
222
221
trayIcon->showMessage (title, text, sicon, millisTimeout);
223
222
}
224
223
225
- // Based on Qt's tray icon implementation
226
224
#ifdef Q_OS_MAC
227
- void Notificator::notifyMacUserNotificationCenter (Class cls, const QString &title, const QString &text, const QIcon &icon) {
225
+ void Notificator::notifyMacUserNotificationCenter (const QString &title, const QString &text)
226
+ {
228
227
// icon is not supported by the user notification center yet. OSX will use the app icon.
229
228
MacNotificationHandler::instance ()->showNotification (title, text);
230
229
}
231
-
232
230
#endif
233
231
234
232
void Notificator::notify (Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout)
@@ -241,11 +239,11 @@ void Notificator::notify(Class cls, const QString &title, const QString &text, c
241
239
break ;
242
240
#endif
243
241
case QSystemTray:
244
- notifySystray (cls, title, text, icon, millisTimeout);
242
+ notifySystray (cls, title, text, millisTimeout);
245
243
break ;
246
244
#ifdef Q_OS_MAC
247
245
case UserNotificationCenter:
248
- notifyMacUserNotificationCenter (cls, title, text, icon );
246
+ notifyMacUserNotificationCenter (title, text);
249
247
break ;
250
248
#endif
251
249
default :
0 commit comments