File tree Expand file tree Collapse file tree 1 file changed +4
-19
lines changed
Expand file tree Collapse file tree 1 file changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -24,25 +24,10 @@ - (NSString *)__bundleIdentifier
2424{
2525 // check if users OS has support for NSUserNotification
2626 if (this ->hasUserNotificationCenterSupport ()) {
27- // okay, seems like 10.8+
28- QByteArray utf8 = title.toUtf8 ();
29- char * cString = (char *)utf8.constData ();
30- NSString *titleMac = [[NSString alloc ] initWithUTF8String: cString];
31-
32- utf8 = text.toUtf8 ();
33- cString = (char *)utf8.constData ();
34- NSString *textMac = [[NSString alloc ] initWithUTF8String: cString];
35-
36- // do everything weak linked (because we will keep <10.8 compatibility)
37- id userNotification = [[NSClassFromString (@" NSUserNotification" ) alloc ] init ];
38- [userNotification performSelector: @selector (setTitle: ) withObject: titleMac];
39- [userNotification performSelector: @selector (setInformativeText: ) withObject: textMac];
40-
41- id notificationCenterInstance = [NSClassFromString (@" NSUserNotificationCenter" ) performSelector: @selector (defaultUserNotificationCenter )];
42- [notificationCenterInstance performSelector: @selector (deliverNotification: ) withObject: userNotification];
43-
44- [titleMac release ];
45- [textMac release ];
27+ NSUserNotification * userNotification = [[NSUserNotification alloc ] init ];
28+ userNotification.title = title.toNSString ();
29+ userNotification.informativeText = text.toNSString ();
30+ [[NSUserNotificationCenter defaultUserNotificationCenter ] deliverNotification: userNotification];
4631 [userNotification release ];
4732 }
4833}
You can’t perform that action at this time.
0 commit comments