summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2012-06-10 04:06:46 +0200
committerSlávek Banko <[email protected]>2012-06-10 04:11:09 +0200
commitef4a78ff54990278f8712404a5934b32f3fd5a9b (patch)
tree5c018ee34b9712a1c1f9c8286313d1978886cefb
parent3575dbebe779de20c17465c43e4658c00188aa72 (diff)
downloadtdenetwork-ef4a78ff54990278f8712404a5934b32f3fd5a9b.tar.gz
tdenetwork-ef4a78ff54990278f8712404a5934b32f3fd5a9b.zip
Improve Kaffeine support in Kopete now listening plugin
(cherry picked from commit f670853164f8a23f3656fa9de72b12b962b9bcaa)
-rw-r--r--kopete/plugins/nowlistening/nlkaffeine.cpp35
1 files changed, 30 insertions, 5 deletions
diff --git a/kopete/plugins/nowlistening/nlkaffeine.cpp b/kopete/plugins/nowlistening/nlkaffeine.cpp
index c2b70ba3..77dd84cb 100644
--- a/kopete/plugins/nowlistening/nlkaffeine.cpp
+++ b/kopete/plugins/nowlistening/nlkaffeine.cpp
@@ -40,7 +40,7 @@ void NLKaffeine::update()
m_newTrack = false;
TQString newTrack;
bool error = true; // Asume we have a error first.
- TQCString kaffeineIface("Kaffeine"), kaffeineGetTrack("getTitle()");
+ TQCString kaffeineIface("KaffeineIface"), kaffeineGetTrack("title()");
// see if kaffeine is registered with DCOP
if ( m_client->isApplicationRegistered( "kaffeine" ) )
@@ -52,10 +52,10 @@ void NLKaffeine::update()
if ( !m_client->call( "kaffeine", kaffeineIface, "isPlaying()", data,
replyType, replyData ) )
{
- kdDebug ( 14307 ) << k_funcinfo << " Trying DCOP interface of Kaffeine >= 0.5" << endl;
- // Trying with the new Kaffeine DCOP interface (>=0.5)
- kaffeineIface = "KaffeineIface";
- kaffeineGetTrack = "title()";
+ kdDebug ( 14307 ) << k_funcinfo << " Trying DCOP interface of Kaffeine < 0.5" << endl;
+ // Trying with the old Kaffeine DCOP interface (<0.5)
+ kaffeineIface = "Kaffeine";
+ kaffeineGetTrack = "getTitle()";
if( !m_client->call( "kaffeine", kaffeineIface, "isPlaying()", data, replyType, replyData ) )
{
kdDebug( 14307 ) << k_funcinfo << " DCOP error on Kaffeine." << endl;
@@ -94,6 +94,31 @@ void NLKaffeine::update()
m_newTrack = true;
m_track = newTrack;
}
+ if ( kaffeineIface == "Kaffeine" )
+ {
+ // old Kaffeine DCOP interface (<0.5)
+ return;
+ }
+
+ if ( m_client->call( "kaffeine", kaffeineIface, "album()", data,
+ replyType, replyData ) )
+ {
+ TQDataStream reply( replyData, IO_ReadOnly );
+
+ if ( replyType == TQSTRING_OBJECT_NAME_STRING ) {
+ reply >> m_album;
+ }
+ }
+
+ if ( m_client->call( "kaffeine", kaffeineIface, "artist()", data,
+ replyType, replyData ) )
+ {
+ TQDataStream reply( replyData, IO_ReadOnly );
+
+ if ( replyType == TQSTRING_OBJECT_NAME_STRING ) {
+ reply >> m_artist;
+ }
+ }
}
else
kdDebug ( 14307 ) << "Kaffeine is not running!\n" << endl;