Clean up.

This commit is contained in:
Black Hat
2019-08-05 10:39:44 +08:00
parent ced82bd666
commit 4bba355da6
4 changed files with 77 additions and 78 deletions

View File

@@ -4,45 +4,34 @@
#include <QtMac>
@interface NSUserNotification (CFIPrivate)
- (void)set_identityImage:(NSImage *)image;
- (void)set_identityImage:(NSImage*)image;
@end
NotificationsManager::NotificationsManager(QObject *parent): QObject(parent)
{
NotificationsManager::NotificationsManager(QObject* parent) : QObject(parent) {}
void NotificationsManager::postNotification(const QString& roomId,
const QString& eventId,
const QString& roomName,
const QString& senderName,
const QString& text,
const QImage& icon) {
Q_UNUSED(roomId);
Q_UNUSED(eventId);
Q_UNUSED(icon);
NSUserNotification* notif = [[NSUserNotification alloc] init];
notif.title = roomName.toNSString();
notif.subtitle = QString("%1 sent a message").arg(senderName).toNSString();
notif.informativeText = text.toNSString();
notif.soundName = NSUserNotificationDefaultSoundName;
[[NSUserNotificationCenter defaultUserNotificationCenter]
deliverNotification:notif];
[notif autorelease];
}
void
NotificationsManager::postNotification(
const QString &roomId,
const QString &eventId,
const QString &roomName,
const QString &senderName,
const QString &text,
const QImage &icon)
{
Q_UNUSED(roomId);
Q_UNUSED(eventId);
Q_UNUSED(icon);
// unused
void NotificationsManager::actionInvoked(uint, QString) {}
NSUserNotification * notif = [[NSUserNotification alloc] init];
notif.title = roomName.toNSString();
notif.subtitle = QString("%1 sent a message").arg(senderName).toNSString();
notif.informativeText = text.toNSString();
notif.soundName = NSUserNotificationDefaultSoundName;
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification: notif];
[notif autorelease];
}
//unused
void
NotificationsManager::actionInvoked(uint, QString)
{
}
void
NotificationsManager::notificationClosed(uint, uint)
{
}
void NotificationsManager::notificationClosed(uint, uint) {}