aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/General/kdenotify/kdenotify.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-04-11 07:50:20 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-04-11 07:50:20 +0000
commitb6de71b1b562861fd9e7576a78991b94d9cd1cb7 (patch)
treeeac02a9638c38a97ff66fcc0fcf933c8dd03e43c /src/plugins/General/kdenotify/kdenotify.cpp
parentf05ae640c6208773aae24695793c7f279bc86759 (diff)
downloadqmmp-b6de71b1b562861fd9e7576a78991b94d9cd1cb7.tar.gz
qmmp-b6de71b1b562861fd9e7576a78991b94d9cd1cb7.tar.bz2
qmmp-b6de71b1b562861fd9e7576a78991b94d9cd1cb7.zip
kdenotify plugin: fixed kde 3.3 support (Artur Guzik)
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1665 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/plugins/General/kdenotify/kdenotify.cpp')
-rw-r--r--src/plugins/General/kdenotify/kdenotify.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/plugins/General/kdenotify/kdenotify.cpp b/src/plugins/General/kdenotify/kdenotify.cpp
index b33f7d789..d1d196362 100644
--- a/src/plugins/General/kdenotify/kdenotify.cpp
+++ b/src/plugins/General/kdenotify/kdenotify.cpp
@@ -36,23 +36,23 @@
#include "kdenotify.h"
-KdeNotify::KdeNotify(QObject *parent) : General(parent),m_useFreedesktopSpec(true)
+KdeNotify::KdeNotify(QObject *parent) : General(parent),m_useFreedesktopSpec(false)
{
- m_notifier = new QDBusInterface("org.freedesktop.Notifications",
- "/org/freedesktop/Notifications","org.freedesktop.Notifications",
- QDBusConnection::sessionBus(), this);
+ m_notifier = new QDBusInterface("org.kde.VisualNotifications",
+ "/VisualNotifications", "org.kde.VisualNotifications",
+ QDBusConnection::sessionBus(), this);
if(m_notifier->lastError().type() != QDBusError::NoError)
{
delete(m_notifier);
- m_notifier = new QDBusInterface("org.kde.VisualNotifications",
- "/VisualNotifications", "org.kde.VisualNotifications",
- QDBusConnection::sessionBus(), this);
+ m_notifier = new QDBusInterface("org.freedesktop.Notifications",
+ "/org/freedesktop/Notifications","org.freedesktop.Notifications",
+ QDBusConnection::sessionBus(), this);
if(m_notifier->lastError().type() != QDBusError::NoError)
{
qWarning() << "KdeNotify: Unable to create interface.";
return;
}
- m_useFreedesktopSpec = false;
+ m_useFreedesktopSpec = true;
}
qWarning() << "KdeNotify: DBus interfece created successfully.";
QString path = QFileInfo(Qmmp::configFile()).absoluteDir().path();
@@ -118,7 +118,7 @@ QList<QVariant> KdeNotify::prepareNotification()
args.append(m_currentNotifyId); //replaces-id;
if(!m_useFreedesktopSpec)
args.append(""); //event-id
- args.append(m_imagesDir + "/app.png"); //app-icon(path to icon on disk)
+ args.append(m_imagesDir + "/app-icon.png"); //app-icon(path to icon on disk)
args.append(tr("Qmmp now playing:")); //summary (notification title)
MetaDataFormatter f(m_template);
@@ -137,12 +137,18 @@ QList<QVariant> KdeNotify::prepareNotification()
if(coverPath.isEmpty())
coverPath = m_imagesDir + "/empty_cover.png";
- QString nBody;
- nBody.append(body);
- args.append(nBody); //body
+ if(m_useFreedesktopSpec)
+ args.append(body); //body
+ else
+ {
+ QString nBody;
+ nBody.append("<table padding=\"3px\"><tr><td width=\"80px\" height=\"80px\" padding=\"3px\">");
+ nBody.append("<img height=\"80\" width=\"80\" src=\"%1\"></td><td width=\"10\"></td><td>%2</td></tr></table>");
+ nBody = nBody.arg(coverPath,body);
+ args.append(nBody);
+ }
args.append(QStringList()); //actions
-
QVariantMap hints;
hints.insert("image_path",coverPath);
args.append(hints); //hints
@@ -168,7 +174,6 @@ void KdeNotify::showMetaData()
void KdeNotify::notificationClosed(uint id, uint reason)
{
Q_UNUSED(reason);
- qWarning() << "notificationClosed: " << id;
if(m_currentNotifyId == id)
m_currentNotifyId = 0;
}