fixd linux

This commit is contained in:
Patrick von Reth 2014-01-18 20:20:59 +01:00
parent 81236c8836
commit 9163753039
4 changed files with 24 additions and 4 deletions

View File

@ -91,6 +91,11 @@ void SnoreBackend::closeNotification(Notification n, NotificationEnums::CloseRea
emit notificationClosed(n);
}
void SnoreBackend::setSupportsRichtext(bool b)
{
m_supportsRichtext = b;
}
void SnoreBackend::slotCloseNotification(Notification notification)
{
Q_UNUSED(notification)

View File

@ -58,6 +58,7 @@ public slots:
protected:
void closeNotification(Snore::Notification,Snore::NotificationEnums::CloseReasons::closeReasons);
void setSupportsRichtext(bool b);
private:

View File

@ -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",
QDBusConnection::sessionBus(), this );
@ -29,11 +29,24 @@ bool FreedesktopBackend::init(SnoreCore *snore){
QDBusPendingReply<QStringList> reply = m_interface->GetCapabilities();
reply.waitForFinished();
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(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 )

View File

@ -10,7 +10,8 @@ class FreedesktopBackend:public Snore::SnoreBackend
Q_PLUGIN_METADATA(IID "org.Snore.NotificationBackend/1.0")
public:
FreedesktopBackend();
virtual bool init(Snore::SnoreCore *snore);
virtual bool initialize(Snore::SnoreCore *snore);
virtual bool deinitialize();
public slots:
void slotNotify( Snore::Notification notification );