Submitted By:            Randy McMurchy <randy_at_linuxfromscratch_dot_org>
Date:                    2006-01-28
Initial Package Version: 3.5.0
Upstream Status:         Unknown
Origin:                  FrugalWare
                         http://ftp.frugalware.org/pub/frugalware/frugalware-current/source/kde/kdemultimedia/
Description:             Fixes issues linking with libtunepimp-0.4.x


--- kdemultimedia-3.5.0/juk/ktrm.cpp.tunepimp-fix	2005-10-10 17:57:16.000000000 +0300
+++ kdemultimedia-3.5.0/juk/ktrm.cpp	2005-11-25 18:55:26.000000000 +0200
@@ -42,7 +42,7 @@ class KTRMLookup;
 
 extern "C"
 {
-    static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId);
+    static void TRMNotifyCallback(tunepimp_t pimp, void *data, TPCallbackEnum type, int fileId, TPFileStatus status);
 }
 
 /**
@@ -66,7 +66,7 @@ public:
         int id;
 
         if(!m_fileMap.contains(lookup->file())) {
-            id = tp_AddFile(m_pimp, QFile::encodeName(lookup->file()));
+            id = tp_AddFile(m_pimp, QFile::encodeName(lookup->file()), 0);
             m_fileMap.insert(lookup->file(), id);
         }
         else {
@@ -120,7 +120,7 @@ protected:
         tp_SetAutoSaveThreshold(m_pimp, -1);
         tp_SetMoveFiles(m_pimp, false);
         tp_SetRenameFiles(m_pimp, false);
-        tp_SetUseUTF8(m_pimp, true);
+        //tp_SetUseUTF8(m_pimp, true);
         tp_SetNotifyCallback(m_pimp, TRMNotifyCallback, 0);
 
         // Re-read proxy config.
@@ -287,13 +287,13 @@ protected:
  * Callback fuction for TunePimp lookup events.
  */
 
-static void TRMNotifyCallback(tunepimp_t pimp, void *, TPCallbackEnum type, int fileId)
+static void TRMNotifyCallback(tunepimp_t pimp, void *, TPCallbackEnum type, int fileId, TPFileStatus status)
 {
     if(type != tpFileChanged)
         return;
 
-    track_t track = tp_GetTrack(pimp, fileId);
-    TPFileStatus status = tr_GetStatus(track);
+    //track_t track = tp_GetTrack(pimp, fileId);
+    //TPFileStatus status = tr_GetStatus(track);
 
     switch(status) {
     case eRecognized:
@@ -501,12 +501,14 @@ void KTRMLookup::collision()
 
             for(int i = 0; i < resultCount; i++) {
                 KTRMResult result;
+		 artistresult_t *artist = &tracks[i]->artist;
+		 albumresult_t *album = &tracks[i]->album;
 
                 result.d->title = QString::fromUtf8(tracks[i]->name);
-                result.d->artist = QString::fromUtf8(tracks[i]->artist->name);
-                result.d->album = QString::fromUtf8(tracks[i]->album->name);
+                result.d->artist = QString::fromUtf8(artist->name);
+                result.d->album = QString::fromUtf8(album->name);
                 result.d->track = tracks[i]->trackNum;
-                result.d->year = tracks[i]->album->releaseYear;
+                result.d->year = album->releaseYear;
                 result.d->relevance = tracks[i]->relevance;
 
                 d->results.append(result);

