diff --git a/src/core/application.cpp b/src/core/application.cpp index ea29cb9..9e64034 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -31,7 +31,8 @@ Application::Application (const QString &name, const Icon &icon) : Application::Application(const Application &other): m_name(other.m_name), m_icon(other.m_icon), - m_alerts(other.m_alerts) + m_alerts(other.m_alerts), + m_hint(other.m_hint) { } @@ -73,6 +74,11 @@ Hint &Application::hints() return m_hint; } +const Hint &Application::hints() const +{ + return m_hint; +} + Alert::Alert (const QString &name, const QString &title, const Icon &icon, bool active): m_name(name), m_title(title), diff --git a/src/core/application.h b/src/core/application.h index 8b71486..f216e24 100644 --- a/src/core/application.h +++ b/src/core/application.h @@ -58,9 +58,9 @@ public: const Icon &icon() const; const QHash &alerts() const; bool isValid() const; + Hint &hints(); - - + const Hint &hints() const; private: QString m_name; Icon m_icon; diff --git a/src/core/hint.cpp b/src/core/hint.cpp index cdf6fd1..3f54d17 100644 --- a/src/core/hint.cpp +++ b/src/core/hint.cpp @@ -20,8 +20,12 @@ using namespace Snore; -Hint::Hint(QObject *parent) : - QObject(parent) +Hint::Hint() +{ +} + +Hint::Hint(const Hint &other): + m_data(other.m_data) { } diff --git a/src/core/hint.h b/src/core/hint.h index 2a05e39..be41c60 100644 --- a/src/core/hint.h +++ b/src/core/hint.h @@ -28,11 +28,11 @@ namespace Snore { -class SNORE_EXPORT Hint : public QObject +class SNORE_EXPORT Hint { - Q_OBJECT public: - explicit Hint(QObject *parent = 0); + Hint(); + Hint(const Hint &other); void setValue(const QString &key, const QVariant &value); QVariant value(const QString & key, const QVariant & defaultValue = QVariant() ) const; diff --git a/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp b/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp index 625c9f2..3cf5569 100644 --- a/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp +++ b/src/plugins/backends/freedesktop/freedesktopnotification_backend.cpp @@ -55,6 +55,11 @@ void FreedesktopBackend::slotNotify ( Notification noti ) hints["urgency"] = (char)noti.priority()+1; } + if(snore()->aplications().value(noti.application()).hints().contains("desktop-entry")) + { + hints["desktop-entry"] = snore()->aplications()[noti.application()].hints().value("desktop-entry"); + } + uint updateId = 0; if(noti.updateID() != 0) {