diff --git a/src/core/notification/icon.cpp b/src/core/notification/icon.cpp index 712b4af..bb6a832 100644 --- a/src/core/notification/icon.cpp +++ b/src/core/notification/icon.cpp @@ -22,7 +22,7 @@ using namespace Snore; -QHash Icon::hasedImages; +QHash Icon::m_localImageCache; Icon::Icon() : d(NULL) @@ -65,15 +65,15 @@ const QImage &Icon::image() const{ QString Icon::localUrl()const{ if(d->m_localUrl.isEmpty()) { - if(hasedImages.contains(hash())) + if(m_localImageCache.contains(hash())) { - d->m_localUrl = hasedImages[hash()]; + d->m_localUrl = m_localImageCache[hash()]; } else { d->m_localUrl = QString("%1%2.png").arg(SnoreCore::snoreTMP(), hash()); image().save(d->m_localUrl ,"PNG"); - hasedImages[hash()] = d->m_localUrl; + m_localImageCache[hash()] = d->m_localUrl; } } return d->m_localUrl; diff --git a/src/core/notification/icon.h b/src/core/notification/icon.h index cc270ba..ad8e6b9 100644 --- a/src/core/notification/icon.h +++ b/src/core/notification/icon.h @@ -46,7 +46,7 @@ public: private: - static QHash hasedImages; + static QHash m_localImageCache; QExplicitlySharedDataPointer d; }; diff --git a/src/core/notification/notification_p.h b/src/core/notification/notification_p.h index 741f207..141182c 100644 --- a/src/core/notification/notification_p.h +++ b/src/core/notification/notification_p.h @@ -26,7 +26,8 @@ public: m_text ( text ), m_icon ( icon ), m_priority(priority), - m_closeReason(NotificationEnums::CloseReasons::NONE) + m_closeReason(NotificationEnums::CloseReasons::NONE), + m_actionInvoked( NULL ) { notificationCount++; qDebug()<< "Creating Notification: ActiveNotifications" << notificationCount << "id" << m_id; @@ -42,7 +43,6 @@ public: uint m_id; uint m_updateID; int m_timeout; - Notification::Action *m_actionInvoked; SnoreFrontend *m_source; QString m_application; QString m_alert; @@ -51,6 +51,7 @@ public: Icon m_icon; NotificationEnums::Prioritys::prioritys m_priority; NotificationEnums::CloseReasons::closeReasons m_closeReason; + Notification::Action *m_actionInvoked; QHash m_actions; Hint m_hints; diff --git a/src/core/version.h b/src/core/version.h index efd7dcc..95cba22 100644 --- a/src/core/version.h +++ b/src/core/version.h @@ -1,5 +1,5 @@ -#ifndef VERSION_H -#define VERSION_H +#ifndef SNORE_VERSION_H +#define SNORE_VERSION_H #undef major #undef minor diff --git a/src/plugins/backends/growl/growl.cpp b/src/plugins/backends/growl/growl.cpp index c994056..1bb283a 100644 --- a/src/plugins/backends/growl/growl.cpp +++ b/src/plugins/backends/growl/growl.cpp @@ -98,7 +98,6 @@ void Growl::gntpCallback(const int &id,const std::string &reason,const std::stri r = NotificationEnums::CloseReasons::DISMISSED; else if(reason == "CLICK"){ r = NotificationEnums::CloseReasons::CLOSED; - n.setActionInvoked(QString(data.c_str()).toInt()); s_instance->snore()->notificationActionInvoked(n); } s_instance->closeNotification(n,r); diff --git a/src/plugins/backends/snarl/snarl.cpp b/src/plugins/backends/snarl/snarl.cpp index 4669dcb..eb415cc 100644 --- a/src/plugins/backends/snarl/snarl.cpp +++ b/src/plugins/backends/snarl/snarl.cpp @@ -82,6 +82,7 @@ public: switch(action){ case SnarlEnums::CallbackInvoked: reason = NotificationEnums::CloseReasons::CLOSED; + m_snarl->snore()->notificationActionInvoked(notification); break; case SnarlEnums::NotifyAction: reason = NotificationEnums::CloseReasons::CLOSED; diff --git a/src/plugins/backends/snoretoast/snoretoast.cpp b/src/plugins/backends/snoretoast/snoretoast.cpp index a70a5d4..e13f8d3 100644 --- a/src/plugins/backends/snoretoast/snoretoast.cpp +++ b/src/plugins/backends/snoretoast/snoretoast.cpp @@ -110,11 +110,7 @@ void SnoreToast::slotToastNotificationClosed(int code, QProcess::ExitStatus) { case 0: reason = NotificationEnums::CloseReasons::CLOSED; - if(!n.actions().isEmpty()) - { - n.setActionInvoked(n.actions().keys().first()); - snore()->notificationActionInvoked(n); - } + snore()->notificationActionInvoked(n); break; case 1: //hidden; diff --git a/src/plugins/backends/trayicon/trayiconnotifer.cpp b/src/plugins/backends/trayicon/trayiconnotifer.cpp index 06934e0..1852c7d 100644 --- a/src/plugins/backends/trayicon/trayiconnotifer.cpp +++ b/src/plugins/backends/trayicon/trayiconnotifer.cpp @@ -70,12 +70,8 @@ void TrayIconNotifer::actionInvoked(){ Notification n = snore()->getActiveNotificationByID(m_displayed); if(n.isValid()){ - if(n.actions().isEmpty()){ - n.setActionInvoked(n.actions().keys().first()); - snore()->notificationActionInvoked(n); - } + snore()->notificationActionInvoked(n); closeNotification(n,NotificationEnums::CloseReasons::CLOSED); - } }