aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/General/kdenotify/kdenotify.cpp22
-rw-r--r--src/plugins/General/kdenotify/kdenotify.h2
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_cs.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_de.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_it.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_lt.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_pl.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_ru.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_tr.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_uk_UA.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_CN.ts6
-rw-r--r--src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_TW.ts6
12 files changed, 47 insertions, 37 deletions
diff --git a/src/plugins/General/kdenotify/kdenotify.cpp b/src/plugins/General/kdenotify/kdenotify.cpp
index 908e21432..419189f3a 100644
--- a/src/plugins/General/kdenotify/kdenotify.cpp
+++ b/src/plugins/General/kdenotify/kdenotify.cpp
@@ -32,17 +32,26 @@
#include <qmmp/metadatamanager.h>
#include "kdenotify.h"
-KdeNotify::KdeNotify(QObject *parent) : General(parent)
+KdeNotify::KdeNotify(QObject *parent) : General(parent),m_UseFreedesktopSpec(false)
{
notifier = new QDBusInterface("org.kde.VisualNotifications",
"/VisualNotifications", "org.kde.VisualNotifications");
if(notifier->lastError().type() != QDBusError::NoError)
{
- qWarning() << "KdeNotify: unable to create dbus interface(" +
- notifier->lastError().message() + ")";
- return;
+ delete(notifier);
+ qWarning() << "KdeNotify: unable to create dbus interface."
+ << "Have you got KDE SC 4.4 or newer? Lets try...";
+
+ notifier = new QDBusInterface("org.freedesktop.Notifications",
+ "/org/freedesktop/Notifications","org.freedesktop.Notifications");
+ if(notifier->lastError().type() != QDBusError::NoError)
+ {
+ qWarning() << "KdeNotify: Can't create interface. Sorry.";
+ return;
+ }
+ m_UseFreedesktopSpec = true;
}
-
+ qWarning() << "KdeNotify: DBus interfece created successfully.";
m_ConfigDir = QFileInfo(Qmmp::configFile()).absoluteDir().path();
QSettings settings(Qmmp::configFile(),QSettings::IniFormat);
@@ -92,7 +101,8 @@ QList<QVariant> KdeNotify::prepareNotification()
args.append("Qmmp"); //app-name
args.append(0U); //replaces-id
- args.append(""); //event-id
+ if(!m_UseFreedesktopSpec)
+ args.append(""); //event-id
args.append(m_ConfigDir + "/app_icon.png"); //app-icon(path to icon on disk)
args.append(tr("Qmmp now playing:")); //summary (notification title)
diff --git a/src/plugins/General/kdenotify/kdenotify.h b/src/plugins/General/kdenotify/kdenotify.h
index 652e111eb..58317d61d 100644
--- a/src/plugins/General/kdenotify/kdenotify.h
+++ b/src/plugins/General/kdenotify/kdenotify.h
@@ -42,7 +42,7 @@ private:
QString m_ConfigDir;
int m_NotifyDelay;
bool m_ShowCovers;
-
+ bool m_UseFreedesktopSpec;
private slots:
void showMetaData();
QString totalTimeString();
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_cs.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_cs.ts
index 6981288e8..c3205d308 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_cs.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_cs.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Qmmp nyní přehrává:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>- </translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>- </translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_de.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_de.ts
index 86da28416..a35e8c10a 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_de.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_de.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Qmmp spielt zurzeit:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>von</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>auf</translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_it.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_it.ts
index c84ad5af7..cb4ca17ba 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_it.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_it.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Qmmp ora in esecuzione:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>di </translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>su </translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_lt.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_lt.ts
index 3bacbeba8..d6ea24065 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_lt.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_lt.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Qmmp dabar groja:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation type="unfinished"></translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_pl.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_pl.ts
index 08ff804ee..d464615aa 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_pl.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_pl.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Qmmp teraz odtwarza:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>przez </translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>na </translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_ru.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_ru.ts
index b1fc4be10..6aa6fe232 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_ru.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_ru.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Играет:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>исполнитель</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>на</translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_tr.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_tr.ts
index f06ed9846..6d4e10a3f 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_tr.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_tr.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation type="unfinished"></translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_uk_UA.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_uk_UA.ts
index 47999a098..ea4ded89d 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_uk_UA.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_uk_UA.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation>Відтворюється:</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation>виконавець</translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation>на</translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_CN.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_CN.ts
index f06ed9846..6d4e10a3f 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_CN.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_CN.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation type="unfinished"></translation>
</message>
diff --git a/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_TW.ts b/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_TW.ts
index f06ed9846..6d4e10a3f 100644
--- a/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_TW.ts
+++ b/src/plugins/General/kdenotify/translations/kdenotify_plugin_zh_TW.ts
@@ -4,17 +4,17 @@
<context>
<name>KdeNotify</name>
<message>
- <location filename="../kdenotify.cpp" line="97"/>
+ <location filename="../kdenotify.cpp" line="107"/>
<source>Qmmp now playing:</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="107"/>
+ <location filename="../kdenotify.cpp" line="117"/>
<source>by </source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="../kdenotify.cpp" line="112"/>
+ <location filename="../kdenotify.cpp" line="122"/>
<source>on </source>
<translation type="unfinished"></translation>
</message>