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):
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),

View File

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

View File

@ -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)
{
}

View File

@ -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;

View File

@ -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)
{