Skip to content

Commit

Permalink
mumble: allow Log_macx.mm to build against the OS X 10.4 SDK (for uni…
Browse files Browse the repository at this point in the history
…versal builds).
  • Loading branch information
mkrautz committed Dec 14, 2013
1 parent 67914c3 commit 3a47d99
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/mumble/Log_macx.mm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include "Log.h"
#include "Global.h"

#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080

@interface MUUserNotificationCenterDelegate : NSObject
@end

Expand All @@ -54,6 +56,8 @@ - (BOOL) userNotificationCenter:(NSUserNotificationCenter *)center shouldPresent
reinterpret_cast<const UniChar *>(string.unicode()), string.length())));
}

#endif

extern bool qt_mac_execute_apple_script(const QString &script, AEDesc *ret);

static bool growl_available() {
Expand Down Expand Up @@ -84,6 +88,7 @@ static bool growl_available() {

void Log::postNotification(MsgType mt, const QString &console, const QString &plain) {
QString title = msgName(mt);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_MOUNTAINLION) {
NSUserNotificationCenter *userNotificationCenter = [NSUserNotificationCenter defaultUserNotificationCenter];
if (userNotificationCenter.delegate == nil) {
Expand All @@ -95,12 +100,14 @@ static bool growl_available() {
userNotification.title = [Log_QString_to_NSString(title) autorelease];
userNotification.informativeText = [Log_QString_to_NSString(plain) autorelease];
[userNotificationCenter scheduleNotification:userNotification];
} else {
} else
#endif
{
QString qsScript = QString::fromLatin1(
"tell application \"GrowlHelperApp\"\n"
" notify with name \"%1\" title \"%1\" description \"%2\" application name \"Mumble\"\n"
"end tell\n").arg(title).arg(plain);
if (growl_available())
qt_mac_execute_apple_script(qsScript, NULL);
}
}
}

0 comments on commit 3a47d99

Please sign in to comment.