[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libgpod transition



* Frank Lichtenheld [Sun, 08 Mar 2009 21:22:57 +0100]:

> For reference, here the error message:
> /tmp/buildd/kipi-plugins-0.1.7/./kipi-plugins/ipodexport/ipodexportdialog.cpp: In member function 'void IpodExport::UploadDialog::ipodItemSelected(QListViewItem*)':
> /tmp/buildd/kipi-plugins-0.1.7/./kipi-plugins/ipodexport/ipodexportdialog.cpp:347: error: 'ITDB_THUMB_PHOTO_SMALL' was not declared in this scope
> /tmp/buildd/kipi-plugins-0.1.7/./kipi-plugins/ipodexport/ipodexportdialog.cpp:347: error: 'itdb_artwork_get_thumb_by_type' was not declared in this scope

> I honestly have no idea of the libgpod API (I only maintain it because
> it got split out from gtkpod which I maintain), so I can't give any
> advice on how to fix that nor any indication on how hard it will be
> to fix it.

Mind applying the attached patch and seeing if it helps? It's grabbed
from the KDE4 branch of the same code, which was recently updated for
this.

If it does help, please file a bug against kipi-plugins including the
patch.

Thanks in advance,

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
Testing can show the presence of bugs, but not their absence.
                -- Dijkstra
This comes from http://websvn.kde.org/?view=rev&revision=918089.

--- kipi-plugins-0.1.7-2/kipi-plugins/ipodexport/ipodexportdialog.cpp~	2009-03-08 21:50:26.000000000 +0100
+++ kipi-plugins-0.1.7-2/kipi-plugins/ipodexport/ipodexportdialog.cpp	2009-03-08 21:51:55.000000000 +0100
@@ -11,6 +11,11 @@
  *                                                                         *
  ***************************************************************************/
 
+// System Includes
+extern "C" {
+#include <gdk-pixbuf/gdk-pixbuf.h>
+}
+
 #include "ipodheader.h"
 #include "imagelist.h"
 #include "imagelistitem.h"
@@ -344,9 +349,13 @@
         return;
 
     Itdb_Artwork *artwork = item->artwork();
-    Itdb_Thumb *thumb = itdb_artwork_get_thumb_by_type( artwork, ITDB_THUMB_PHOTO_SMALL );
+    GdkPixbuf *gpixbuf = NULL;
+    
+    // First arg in itdb_artwork_get_pixbuf(...) is pointer to Itdb_Device struct,
+    // in kipiplugin-ipodexport it is m_itdb->device. i hope it _is_ initialiezed
+    gpixbuf = (GdkPixbuf*) itdb_artwork_get_pixbuf( m_itdb->device, artwork, -1, -1 );
 
-    if( !thumb )
+    if( !gpixbuf )
     {
         debug() << "no thumb was found" << endl;
         return;
@@ -361,6 +370,9 @@
 //     QPixmap pix;
 //     pix.convertFromImage( image );
 //     m_ipodPreview->setPixmap( pix );
+    
+    // memory release
+    gdk_pixbuf_unref ( gpixbuf );
 }
 
 void

Reply to: