make the freedesktop backend use desktop-entry

This commit is contained in:
Patrick von Reth 2014-01-12 20:32:43 +01:00
parent ad0b79d544
commit 570208f8dd
5 changed files with 23 additions and 8 deletions

View File

@ -31,7 +31,8 @@ Application::Application (const QString &name, const Icon &icon) :
Application::Application(const Application &other): Application::Application(const Application &other):
m_name(other.m_name), m_name(other.m_name),
m_icon(other.m_icon), 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; return m_hint;
} }
const Hint &Application::hints() const
{
return m_hint;
}
Alert::Alert (const QString &name, const QString &title, const Icon &icon, bool active): Alert::Alert (const QString &name, const QString &title, const Icon &icon, bool active):
m_name(name), m_name(name),
m_title(title), m_title(title),

View File

@ -58,9 +58,9 @@ public:
const Icon &icon() const; const Icon &icon() const;
const QHash<QString,Alert> &alerts() const; const QHash<QString,Alert> &alerts() const;
bool isValid() const; bool isValid() const;
Hint &hints(); Hint &hints();
const Hint &hints() const;
private: private:
QString m_name; QString m_name;
Icon m_icon; Icon m_icon;

View File

@ -20,8 +20,12 @@
using namespace Snore; using namespace Snore;
Hint::Hint(QObject *parent) : Hint::Hint()
QObject(parent) {
}
Hint::Hint(const Hint &other):
m_data(other.m_data)
{ {
} }

View File

@ -28,11 +28,11 @@ namespace Snore
{ {
class SNORE_EXPORT Hint : public QObject class SNORE_EXPORT Hint
{ {
Q_OBJECT
public: public:
explicit Hint(QObject *parent = 0); Hint();
Hint(const Hint &other);
void setValue(const QString &key, const QVariant &value); void setValue(const QString &key, const QVariant &value);
QVariant value(const QString & key, const QVariant & defaultValue = QVariant() ) const; QVariant value(const QString & key, const QVariant & defaultValue = QVariant() ) const;

View File

@ -55,6 +55,11 @@ void FreedesktopBackend::slotNotify ( Notification noti )
hints["urgency"] = (char)noti.priority()+1; 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; uint updateId = 0;
if(noti.updateID() != 0) if(noti.updateID() != 0)
{ {