fixd linux
This commit is contained in:
parent
81236c8836
commit
9163753039
|
@ -91,6 +91,11 @@ void SnoreBackend::closeNotification(Notification n, NotificationEnums::CloseRea
|
||||||
emit notificationClosed(n);
|
emit notificationClosed(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SnoreBackend::setSupportsRichtext(bool b)
|
||||||
|
{
|
||||||
|
m_supportsRichtext = b;
|
||||||
|
}
|
||||||
|
|
||||||
void SnoreBackend::slotCloseNotification(Notification notification)
|
void SnoreBackend::slotCloseNotification(Notification notification)
|
||||||
{
|
{
|
||||||
Q_UNUSED(notification)
|
Q_UNUSED(notification)
|
||||||
|
|
|
@ -58,6 +58,7 @@ public slots:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeNotification(Snore::Notification,Snore::NotificationEnums::CloseReasons::closeReasons);
|
void closeNotification(Snore::Notification,Snore::NotificationEnums::CloseReasons::closeReasons);
|
||||||
|
void setSupportsRichtext(bool b);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -21,7 +21,7 @@ FreedesktopBackend::FreedesktopBackend () :
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FreedesktopBackend::init(SnoreCore *snore){
|
bool FreedesktopBackend::initialize(SnoreCore *snore){
|
||||||
|
|
||||||
m_interface = new org::freedesktop::Notifications( "org.freedesktop.Notifications", "/org/freedesktop/Notifications",
|
m_interface = new org::freedesktop::Notifications( "org.freedesktop.Notifications", "/org/freedesktop/Notifications",
|
||||||
QDBusConnection::sessionBus(), this );
|
QDBusConnection::sessionBus(), this );
|
||||||
|
@ -29,11 +29,24 @@ bool FreedesktopBackend::init(SnoreCore *snore){
|
||||||
QDBusPendingReply<QStringList> reply = m_interface->GetCapabilities();
|
QDBusPendingReply<QStringList> reply = m_interface->GetCapabilities();
|
||||||
reply.waitForFinished();
|
reply.waitForFinished();
|
||||||
QStringList caps = reply.value();
|
QStringList caps = reply.value();
|
||||||
m_supportsRichtext = caps.contains( "body-markup" );
|
setSupportsRichtext(caps.contains( "body-markup" ));
|
||||||
connect(m_interface, SIGNAL(ActionInvoked(uint,QString)), this, SLOT(slotActionInvoked(uint,QString)));
|
connect(m_interface, SIGNAL(ActionInvoked(uint,QString)), this, SLOT(slotActionInvoked(uint,QString)));
|
||||||
connect(m_interface, SIGNAL(NotificationClosed(uint,uint)), this , SLOT(slotNotificationClosed(uint,uint)));
|
connect(m_interface, SIGNAL(NotificationClosed(uint,uint)), this , SLOT(slotNotificationClosed(uint,uint)));
|
||||||
|
|
||||||
return SnoreBackend::init(snore);
|
return SnoreBackend::initialize(snore);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool FreedesktopBackend::deinitialize()
|
||||||
|
{
|
||||||
|
if(SnoreBackend::deinitialize())
|
||||||
|
{
|
||||||
|
disconnect(m_interface, SIGNAL(ActionInvoked(uint,QString)), this, SLOT(slotActionInvoked(uint,QString)));
|
||||||
|
disconnect(m_interface, SIGNAL(NotificationClosed(uint,uint)), this , SLOT(slotNotificationClosed(uint,uint)));
|
||||||
|
m_interface->deleteLater();
|
||||||
|
m_interface = NULL;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FreedesktopBackend::slotNotify ( Notification noti )
|
void FreedesktopBackend::slotNotify ( Notification noti )
|
||||||
|
|
|
@ -10,7 +10,8 @@ class FreedesktopBackend:public Snore::SnoreBackend
|
||||||
Q_PLUGIN_METADATA(IID "org.Snore.NotificationBackend/1.0")
|
Q_PLUGIN_METADATA(IID "org.Snore.NotificationBackend/1.0")
|
||||||
public:
|
public:
|
||||||
FreedesktopBackend();
|
FreedesktopBackend();
|
||||||
virtual bool init(Snore::SnoreCore *snore);
|
virtual bool initialize(Snore::SnoreCore *snore);
|
||||||
|
virtual bool deinitialize();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void slotNotify( Snore::Notification notification );
|
void slotNotify( Snore::Notification notification );
|
||||||
|
|
Loading…
Reference in New Issue