make the freedesktop backend use desktop-entry
This commit is contained in:
parent
ad0b79d544
commit
570208f8dd
|
@ -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),
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue