Make freedesktop notifications markup detection not block.

This commit is contained in:
Patrick von Reth 2015-09-10 17:39:48 +02:00
parent 2c178b2fe4
commit e898a73122
1 changed files with 6 additions and 3 deletions

View File

@ -16,9 +16,12 @@ FreedesktopBackend::FreedesktopBackend()
QLatin1String("/org/freedesktop/Notifications"),
QDBusConnection::sessionBus(), this);
QDBusPendingReply<QStringList> reply = m_interface->GetCapabilities();
reply.waitForFinished();
QStringList caps = reply.value();
m_supportsRichtext = caps.contains(QLatin1String("body-markup"));
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
connect(watcher, &QDBusPendingCallWatcher::finished, [reply, watcher, this](){
qDebug() << reply.value();
m_supportsRichtext = reply.value().contains(QLatin1String("body-markup"));
watcher->deleteLater();
});
connect(this, &FreedesktopBackend::enabledChanged, [this](bool enabled) {
if (enabled) {
connect(m_interface, &org::freedesktop::Notifications::ActionInvoked, this, &FreedesktopBackend::slotActionInvoked);