@@ -39,7 +39,7 @@ Notificator::Notificator(const QString &_programName, QSystemTrayIcon *_trayIcon
3939 mode(None),
4040 trayIcon(_trayIcon)
4141#ifdef USE_DBUS
42- ,interface(0 )
42+ ,interface(nullptr )
4343#endif
4444{
4545 if (_trayIcon && _trayIcon->supportsMessages ())
@@ -154,14 +154,14 @@ QVariant FreedesktopImage::toVariant(const QImage &img)
154154
155155void Notificator::notifyDBus (Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout)
156156{
157- Q_UNUSED (cls);
158- // Arguments for DBus call:
157+ // https://developer.gnome.org/notification-spec/
158+ // Arguments for DBus "Notify" call:
159159 QList<QVariant> args;
160160
161161 // Program Name:
162162 args.append (programName);
163163
164- // Unique ID of this notification type :
164+ // Replaces ID; A value of 0 means that this notification won't replace any existing notifications :
165165 args.append (0U );
166166
167167 // Application Icon, empty string
@@ -209,9 +209,8 @@ void Notificator::notifyDBus(Class cls, const QString &title, const QString &tex
209209}
210210#endif
211211
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)
213213{
214- Q_UNUSED (icon);
215214 QSystemTrayIcon::MessageIcon sicon = QSystemTrayIcon::NoIcon;
216215 switch (cls) // Set icon based on class
217216 {
@@ -222,13 +221,12 @@ void Notificator::notifySystray(Class cls, const QString &title, const QString &
222221 trayIcon->showMessage (title, text, sicon, millisTimeout);
223222}
224223
225- // Based on Qt's tray icon implementation
226224#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+ {
228227 // icon is not supported by the user notification center yet. OSX will use the app icon.
229228 MacNotificationHandler::instance ()->showNotification (title, text);
230229}
231-
232230#endif
233231
234232void 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
241239 break ;
242240#endif
243241 case QSystemTray:
244- notifySystray (cls, title, text, icon, millisTimeout);
242+ notifySystray (cls, title, text, millisTimeout);
245243 break ;
246244#ifdef Q_OS_MAC
247245 case UserNotificationCenter:
248- notifyMacUserNotificationCenter (cls, title, text, icon );
246+ notifyMacUserNotificationCenter (title, text);
249247 break ;
250248#endif
251249 default :
0 commit comments