summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVincent A <vincent@ftopia.com>2012-03-07 19:24:29 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-12 07:44:01 +0100
commit37546c563e32960fbf50d4a692993721ae2da273 (patch)
tree2837085f48da606ba1595237a6bf649291825954 /src
parent0e905e91382ac5903c8784a28ed6b5a15adf404e (diff)
Support Growl >=1.3 in QSystemTrayIcon
The app name has changed in Growl 1.3, but the id stays the same. Also don't send notifications if Growl is not running to follow recommendations. Change-Id: I31ff7df272b4af1b4f1e4db80c47e7ba75038dec Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/util/qsystemtrayicon_mac.mm8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widgets/util/qsystemtrayicon_mac.mm b/src/widgets/util/qsystemtrayicon_mac.mm
index 59342cb8a4..7f7d7cdc6a 100644
--- a/src/widgets/util/qsystemtrayicon_mac.mm
+++ b/src/widgets/util/qsystemtrayicon_mac.mm
@@ -260,7 +260,11 @@ void QSystemTrayIconPrivate::showMessage_sys(const QString &title, const QString
notificationIcon = QLatin1String("image from location \"file://") + notificationIconFile.fileName() + QLatin1String("\"");
}
const QString script(QLatin1String(
- "tell application \"GrowlHelperApp\"\n"
+ "tell application \"System Events\"\n"
+ "set isRunning to (count of (every process whose bundle identifier is \"com.Growl.GrowlHelperApp\")) > 0\n"
+ "end tell\n"
+ "if isRunning\n"
+ "tell application id \"com.Growl.GrowlHelperApp\"\n"
"-- Make a list of all the notification types (all)\n"
"set the allNotificationsList to {\"") + notificationType + QLatin1String("\"}\n"
@@ -276,7 +280,7 @@ void QSystemTrayIconPrivate::showMessage_sys(const QString &title, const QString
QLatin1String("\" description \"") + message +
QLatin1String("\" application name \"") + notificationApp +
QLatin1String("\" ") + notificationIcon +
- QLatin1String("\nend tell"));
+ QLatin1String("\nend tell\nend if"));
qt_mac_execute_apple_script(script, 0);
#elif 0
Q_Q(QSystemTrayIcon);