@@ -57,21 +57,6 @@ Notificator::Notificator(const QString& programName, QSystemTrayIcon* trayicon,
5757 // check if users OS has support for NSUserNotification
5858 if (MacNotificationHandler::instance ()->hasUserNotificationCenterSupport ()) {
5959 mode = UserNotificationCenter;
60- } else {
61- // Check if Growl is installed (based on Qt's tray icon implementation)
62- CFURLRef cfurl;
63- OSStatus status = LSGetApplicationForInfo (kLSUnknownType , kLSUnknownCreator , CFSTR (" growlTicket" ), kLSRolesAll , 0 , &cfurl);
64- if (status != kLSApplicationNotFoundErr ) {
65- CFBundleRef bundle = CFBundleCreate (0 , cfurl);
66- if (CFStringCompare (CFBundleGetIdentifier (bundle), CFSTR (" com.Growl.GrowlHelperApp" ), kCFCompareCaseInsensitive | kCFCompareBackwards ) == kCFCompareEqualTo ) {
67- if (CFStringHasSuffix (CFURLGetString (cfurl), CFSTR (" /Growl.app/" )))
68- mode = Growl13;
69- else
70- mode = Growl12;
71- }
72- CFRelease (cfurl);
73- CFRelease (bundle);
74- }
7560 }
7661#endif
7762}
@@ -245,55 +230,6 @@ void Notificator::notifySystray(Class cls, const QString& title, const QString&
245230
246231// Based on Qt's tray icon implementation
247232#ifdef Q_OS_MAC
248- void Notificator::notifyGrowl (Class cls, const QString& title, const QString& text, const QIcon& icon)
249- {
250- const QString script (
251- " tell application \" %5\"\n "
252- " set the allNotificationsList to {\" Notification\" }\n " // -- Make a list of all the notification types (all)
253- " set the enabledNotificationsList to {\" Notification\" }\n " // -- Make a list of the notifications (enabled)
254- " register as application \" %1\" all notifications allNotificationsList default notifications enabledNotificationsList\n " // -- Register our script with Growl
255- " notify with name \" Notification\" title \" %2\" description \" %3\" application name \" %1\" %4\n " // -- Send a Notification
256- " end tell" );
257-
258- QString notificationApp (QApplication::applicationName ());
259- if (notificationApp.isEmpty ())
260- notificationApp = " Application" ;
261-
262- QPixmap notificationIconPixmap;
263- if (icon.isNull ()) { // If no icon specified, set icon based on class
264- QStyle::StandardPixmap sicon = QStyle::SP_MessageBoxQuestion;
265- switch (cls) {
266- case Information:
267- sicon = QStyle::SP_MessageBoxInformation;
268- break ;
269- case Warning:
270- sicon = QStyle::SP_MessageBoxWarning;
271- break ;
272- case Critical:
273- sicon = QStyle::SP_MessageBoxCritical;
274- break ;
275- }
276- notificationIconPixmap = QApplication::style ()->standardPixmap (sicon);
277- } else {
278- QSize size = icon.actualSize (QSize (48 , 48 ));
279- notificationIconPixmap = icon.pixmap (size);
280- }
281-
282- QString notificationIcon;
283- QTemporaryFile notificationIconFile;
284- if (!notificationIconPixmap.isNull () && notificationIconFile.open ()) {
285- QImageWriter writer (¬ificationIconFile, " PNG" );
286- if (writer.write (notificationIconPixmap.toImage ()))
287- notificationIcon = QString (" image from location \" file://%1\" " ).arg (notificationIconFile.fileName ());
288- }
289-
290- QString quotedTitle (title), quotedText (text);
291- quotedTitle.replace (" \\ " , " \\\\ " ).replace (" \" " , " \\ " );
292- quotedText.replace (" \\ " , " \\\\ " ).replace (" \" " , " \\ " );
293- QString growlApp (this ->mode == Notificator::Growl13 ? " Growl" : " GrowlHelperApp" );
294- MacNotificationHandler::instance ()->sendAppleScript (script.arg (notificationApp, quotedTitle, quotedText, notificationIcon, growlApp));
295- }
296-
297233void Notificator::notifyMacUserNotificationCenter (Class cls, const QString& title, const QString& text, const QIcon& icon)
298234{
299235 // icon is not supported by the user notification center yet. OSX will use the app icon.
@@ -317,10 +253,6 @@ void Notificator::notify(Class cls, const QString& title, const QString& text, c
317253 case UserNotificationCenter:
318254 notifyMacUserNotificationCenter (cls, title, text, icon);
319255 break ;
320- case Growl12:
321- case Growl13:
322- notifyGrowl (cls, title, text, icon);
323- break ;
324256#endif
325257 default :
326258 if (cls == Critical) {
0 commit comments