@@ -60,22 +60,6 @@ Notificator::Notificator(const QString &_programName, QSystemTrayIcon *_trayIcon
6060 if ( MacNotificationHandler::instance ()->hasUserNotificationCenterSupport ()) {
6161 mode = UserNotificationCenter;
6262 }
63- else {
64- // Check if Growl is installed (based on Qt's tray icon implementation)
65- CFURLRef cfurl;
66- OSStatus status = LSGetApplicationForInfo (kLSUnknownType , kLSUnknownCreator , CFSTR (" growlTicket" ), kLSRolesAll , 0 , &cfurl);
67- if (status != kLSApplicationNotFoundErr ) {
68- CFBundleRef bundle = CFBundleCreate (0 , cfurl);
69- if (CFStringCompare (CFBundleGetIdentifier (bundle), CFSTR (" com.Growl.GrowlHelperApp" ), kCFCompareCaseInsensitive | kCFCompareBackwards ) == kCFCompareEqualTo ) {
70- if (CFStringHasSuffix (CFURLGetString (cfurl), CFSTR (" /Growl.app/" )))
71- mode = Growl13;
72- else
73- mode = Growl12;
74- }
75- CFRelease (cfurl);
76- CFRelease (bundle);
77- }
78- }
7963#endif
8064}
8165
@@ -241,52 +225,6 @@ void Notificator::notifySystray(Class cls, const QString &title, const QString &
241225
242226// Based on Qt's tray icon implementation
243227#ifdef Q_OS_MAC
244- void Notificator::notifyGrowl (Class cls, const QString &title, const QString &text, const QIcon &icon)
245- {
246- const QString script (
247- " tell application \" %5\"\n "
248- " set the allNotificationsList to {\" Notification\" }\n " // -- Make a list of all the notification types (all)
249- " set the enabledNotificationsList to {\" Notification\" }\n " // -- Make a list of the notifications (enabled)
250- " register as application \" %1\" all notifications allNotificationsList default notifications enabledNotificationsList\n " // -- Register our script with Growl
251- " notify with name \" Notification\" title \" %2\" description \" %3\" application name \" %1\" %4\n " // -- Send a Notification
252- " end tell"
253- );
254-
255- QString notificationApp (QApplication::applicationName ());
256- if (notificationApp.isEmpty ())
257- notificationApp = " Application" ;
258-
259- QPixmap notificationIconPixmap;
260- if (icon.isNull ()) { // If no icon specified, set icon based on class
261- QStyle::StandardPixmap sicon = QStyle::SP_MessageBoxQuestion;
262- switch (cls)
263- {
264- case Information: sicon = QStyle::SP_MessageBoxInformation; break ;
265- case Warning: sicon = QStyle::SP_MessageBoxWarning; break ;
266- case Critical: sicon = QStyle::SP_MessageBoxCritical; break ;
267- }
268- notificationIconPixmap = QApplication::style ()->standardPixmap (sicon);
269- }
270- else {
271- QSize size = icon.actualSize (QSize (48 , 48 ));
272- notificationIconPixmap = icon.pixmap (size);
273- }
274-
275- QString notificationIcon;
276- QTemporaryFile notificationIconFile;
277- if (!notificationIconPixmap.isNull () && notificationIconFile.open ()) {
278- QImageWriter writer (¬ificationIconFile, " PNG" );
279- if (writer.write (notificationIconPixmap.toImage ()))
280- notificationIcon = QString (" image from location \" file://%1\" " ).arg (notificationIconFile.fileName ());
281- }
282-
283- QString quotedTitle (title), quotedText (text);
284- quotedTitle.replace (" \\ " , " \\\\ " ).replace (" \" " , " \\ " );
285- quotedText.replace (" \\ " , " \\\\ " ).replace (" \" " , " \\ " );
286- QString growlApp (this ->mode == Notificator::Growl13 ? " Growl" : " GrowlHelperApp" );
287- MacNotificationHandler::instance ()->sendAppleScript (script.arg (notificationApp, quotedTitle, quotedText, notificationIcon, growlApp));
288- }
289-
290228void Notificator::notifyMacUserNotificationCenter (Class cls, const QString &title, const QString &text, const QIcon &icon) {
291229 // icon is not supported by the user notification center yet. OSX will use the app icon.
292230 MacNotificationHandler::instance ()->showNotification (title, text);
@@ -310,10 +248,6 @@ void Notificator::notify(Class cls, const QString &title, const QString &text, c
310248 case UserNotificationCenter:
311249 notifyMacUserNotificationCenter (cls, title, text, icon);
312250 break ;
313- case Growl12:
314- case Growl13:
315- notifyGrowl (cls, title, text, icon);
316- break ;
317251#endif
318252 default :
319253 if (cls == Critical)
0 commit comments