Skip to content

Commit

Permalink
[macOS] remove Growl support, remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
barton2526 committed Sep 28, 2021
1 parent c5d908f commit 3ca9443
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
7 changes: 2 additions & 5 deletions src/qt/macnotificationhandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,17 @@

#include <QObject>

/** Macintosh-specific notification handler (supports UserNotificationCenter and Growl).
/** Macintosh-specific notification handler (supports UserNotificationCenter).
*/
class MacNotificationHandler : public QObject
{
Q_OBJECT

public:
/** shows a 10.8+ UserNotification in the UserNotificationCenter
/** shows a macOS 10.8+ UserNotification in the UserNotificationCenter
*/
void showNotification(const QString &title, const QString &text);

/** executes AppleScript */
void sendAppleScript(const QString &script);

/** check if OS can handle UserNotifications */
bool hasUserNotificationCenterSupport(void);
static MacNotificationHandler *instance();
Expand Down
14 changes: 0 additions & 14 deletions src/qt/macnotificationhandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,6 @@
}
}

// sendAppleScript just take a QString and executes it as apple script
void MacNotificationHandler::sendAppleScript(const QString &script)
{
QByteArray utf8 = script.toUtf8();
char* cString = (char *)utf8.constData();
NSString *scriptApple = [[NSString alloc] initWithUTF8String:cString];

NSAppleScript *as = [[NSAppleScript alloc] initWithSource:scriptApple];
NSDictionary *err = nil;
[as executeAndReturnError:&err];
[as release];
[scriptApple release];
}

bool MacNotificationHandler::hasUserNotificationCenterSupport(void)
{
Class possibleClass = NSClassFromString(@"NSUserNotificationCenter");
Expand Down
3 changes: 0 additions & 3 deletions src/qt/notificator.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ public slots:
None, /**< Ignore informational notifications, and show a modal pop-up dialog for Critical notifications. */
Freedesktop, /**< Use DBus org.freedesktop.Notifications */
QSystemTray, /**< Use QSystemTrayIcon::showMessage() */
Growl12, /**< Use the Growl 1.2 notification system (Mac only) */
Growl13, /**< Use the Growl 1.3 notification system (Mac only) */
UserNotificationCenter /**< Use the 10.8+ User Notification Center (Mac only) */
};
QString programName;
Expand All @@ -63,7 +61,6 @@ public slots:
#endif
void notifySystray(Class cls, const QString &title, const QString &text, int millisTimeout);
#ifdef Q_OS_MAC
void notifyGrowl(Class cls, const QString &title, const QString &text, const QIcon &icon);
void notifyMacUserNotificationCenter(const QString &title, const QString &text);
#endif
};
Expand Down

0 comments on commit 3ca9443

Please sign in to comment.