Fix systray class when built without FDO support

This commit is contained in:
Daniel Molkentin 2013-05-22 17:39:49 +02:00
parent 804eaa700e
commit dbc085d4d4

View file

@ -26,21 +26,17 @@
void Systray::showMessage(const QString & title, const QString & message, MessageIcon icon, int millisecondsTimeoutHint) void Systray::showMessage(const QString & title, const QString & message, MessageIcon icon, int millisecondsTimeoutHint)
{ {
bool useFdoNotifications = false;
#ifdef USE_FDO_NOTIFICATIONS #ifdef USE_FDO_NOTIFICATIONS
if(QDBusInterface(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE).isValid()) { if(QDBusInterface(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE).isValid()) {
useFdoNotifications = true;
}
#endif
if (useFdoNotifications) {
QList<QVariant> args = QList<QVariant>() << "owncloud" << quint32(0) << "owncloud" QList<QVariant> args = QList<QVariant>() << "owncloud" << quint32(0) << "owncloud"
<< title << message << QStringList () << QVariantMap() << qint32(-1); << title << message << QStringList () << QVariantMap() << qint32(-1);
QDBusMessage method = QDBusMessage::createMethodCall(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE, "Notify"); QDBusMessage method = QDBusMessage::createMethodCall(NOTIFICATIONS_SERVICE, NOTIFICATIONS_PATH, NOTIFICATIONS_IFACE, "Notify");
method.setArguments(args); method.setArguments(args);
QDBusConnection::sessionBus().asyncCall(method); QDBusConnection::sessionBus().asyncCall(method);
} else { } else
#endif
{
QSystemTrayIcon::showMessage(title, message, icon, millisecondsTimeoutHint); QSystemTrayIcon::showMessage(title, message, icon, millisecondsTimeoutHint);
} }
} }