mirror of
https://github.com/status-im/snorenotify.git
synced 2025-02-18 19:26:36 +00:00
rename methode to be compatible with older version
This commit is contained in:
parent
dab3728eee
commit
faf95d9ed3
@ -194,7 +194,7 @@ void SnoreBackend::startTimeout(Notification ¬ification)
|
|||||||
//dont use a capture for notification, as it can leak
|
//dont use a capture for notification, as it can leak
|
||||||
uint id = notification.id();
|
uint id = notification.id();
|
||||||
connect(timer, &QTimer::timeout, [id](){
|
connect(timer, &QTimer::timeout, [id](){
|
||||||
Notification notification = SnoreCore::instance().activeNotificationById(id);
|
Notification notification = SnoreCore::instance().getActiveNotificationByID(id);
|
||||||
if(notification.isValid()){
|
if(notification.isValid()){
|
||||||
snoreDebug(SNORE_DEBUG) << notification;
|
snoreDebug(SNORE_DEBUG) << notification;
|
||||||
SnoreCore::instance().requestCloseNotification(notification, Notification::TIMED_OUT);
|
SnoreCore::instance().requestCloseNotification(notification, Notification::TIMED_OUT);
|
||||||
|
@ -233,7 +233,7 @@ void SnoreCore::setDefaultValue(const QString &key, const QVariant &value, Setti
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Notification SnoreCore::activeNotificationById(uint id) const
|
Notification SnoreCore::getActiveNotificationByID(uint id) const
|
||||||
{
|
{
|
||||||
Q_D(const SnoreCore);
|
Q_D(const SnoreCore);
|
||||||
return d->m_activeNotifications.value(id);
|
return d->m_activeNotifications.value(id);
|
||||||
|
@ -150,7 +150,7 @@ public:
|
|||||||
void setValue(const QString &key, const QVariant &value, SettingsType type = GLOBAL_SETTING);
|
void setValue(const QString &key, const QVariant &value, SettingsType type = GLOBAL_SETTING);
|
||||||
void setDefaultValue(const QString &key, const QVariant &value, SettingsType type = GLOBAL_SETTING);
|
void setDefaultValue(const QString &key, const QVariant &value, SettingsType type = GLOBAL_SETTING);
|
||||||
|
|
||||||
Notification activeNotificationById(uint id) const;
|
Notification getActiveNotificationByID(uint id) const;
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
* This signal is emitted when an action on the Notification was performed.
|
* This signal is emitted when an action on the Notification was performed.
|
||||||
|
@ -45,7 +45,7 @@ bool GrowlBackend::initialize()
|
|||||||
s_instance = this;
|
s_instance = this;
|
||||||
auto func = [](growl_callback_data *data)->void{
|
auto func = [](growl_callback_data *data)->void{
|
||||||
snoreDebug(SNORE_DEBUG) << data->id << QString(data->reason) << QString(data->data);
|
snoreDebug(SNORE_DEBUG) << data->id << QString(data->reason) << QString(data->data);
|
||||||
Notification n = Snore::SnoreCore::instance().activeNotificationById(data->id);
|
Notification n = Snore::SnoreCore::instance().getActiveNotificationByID(data->id);
|
||||||
if (!n.isValid()) {
|
if (!n.isValid()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Notification noti;
|
Notification noti;
|
||||||
Notification toReplace = SnoreCore::instance().activeNotificationById(replaces_id);
|
Notification toReplace = SnoreCore::instance().getActiveNotificationByID(replaces_id);
|
||||||
if (replaces_id != 0 && toReplace.isValid()) {
|
if (replaces_id != 0 && toReplace.isValid()) {
|
||||||
noti = Notification(toReplace, summary, body, icon, timeout == -1 ? Notification::defaultTimeout() : timeout / 1000, priotity);
|
noti = Notification(toReplace, summary, body, icon, timeout == -1 ? Notification::defaultTimeout() : timeout / 1000, priotity);
|
||||||
} else {
|
} else {
|
||||||
@ -141,7 +141,7 @@ uint FreedesktopFrontend::Notify(const QString &app_name, uint replaces_id,
|
|||||||
|
|
||||||
void FreedesktopFrontend::CloseNotification(uint id)
|
void FreedesktopFrontend::CloseNotification(uint id)
|
||||||
{
|
{
|
||||||
Notification noti = SnoreCore::instance().activeNotificationById(id);
|
Notification noti = SnoreCore::instance().getActiveNotificationByID(id);
|
||||||
if (noti.isValid()) {
|
if (noti.isValid()) {
|
||||||
SnoreCore::instance().requestCloseNotification(noti, Notification::TIMED_OUT);
|
SnoreCore::instance().requestCloseNotification(noti, Notification::TIMED_OUT);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user