From kde-commits Sat Jan 31 14:27:59 2009 From: Gilles Caulier Date: Sat, 31 Jan 2009 14:27:59 +0000 To: kde-commits Subject: branches/extragear/kde3/libs/kipi-plugins Message-Id: <1233412079.535829.22686.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=123341209907417 SVN commit 919107 by cgilles: Kipiplugins from KDE3 branch : patch from Dmitrij S. Kryzhevich to compile IpodExport with new LibGpod api. BUG: 181334 CCMAIL: ruiz@kde.org CCMAIL: krege@land.ru M +3 -2 README M +12 -2 configure.in.bot M +32 -2 configure.in.in M +2 -1 ipodexport/Makefile.am M +13 -2 ipodexport/ipodexportdialog.cpp --- branches/extragear/kde3/libs/kipi-plugins/README #919106:919107 @@ -114,7 +114,8 @@ libkexiv2 >= 0.1.5 http://www.kipi-plugins.org libkdcraw >= 0.1.6 http://www.kipi-plugins.org libxslt >= 1.1 http://xmlsoft.org/XSLT -libgpod >= 0.4.2 http://www.gtkpod.org/libgpod +libgpod >= 0.7.0 http://www.gtkpod.org/libgpod +libgdk >= 2.0.0 http://library.gnome.org/devel/gdk-pixbuf libkcal >= 3.4.x http://pim.kde.org ImageMagick >= 5.5.4 (runtime dependency) http://www.imagemagick.org MJPEGTools >= 1.6.0 (runtime dependency) http://mjpeg.sourceforge.net @@ -135,5 +136,5 @@ rawconverter : libtiff acquireimages : libtiff htmlexport : libxslt -ipodexport : libgpod +ipodexport : libgpod, libgdk calendar : libkcal --- branches/extragear/kde3/libs/kipi-plugins/configure.in.bot #919106:919107 @@ -124,7 +124,7 @@ if test "x$have_libgpod" != "xyes"; then echo "-- libgpod found.................. NO" echo "" - echo "iPodExport plugin needs the libgpod library, version 0.4.2 or greater. This plugin will not be compiled!" + echo "iPodExport plugin needs the libgpod library, version 0.7.0 or greater. This plugin will not be compiled!" echo "To complile this plugin, please install libgpod development package." echo "libgpod website is at http://gtkpod.org/libgpod.html" echo "" @@ -132,8 +132,18 @@ else echo "-- libgpod found.................. YES" fi + if test "x$have_gdk" != "xyes"; then + echo "-- gdk found...................... NO" + echo "" + echo "iPodExport plugin needs the GDK (GTK+ Drawing Kit) library, the part of GTK2. This plugin will not be compiled!" + echo "To complile this plugin, please install GDK development package." + echo "" + all_tests=bad + else + echo "-- GDK found...................... YES" + fi else - echo "-- libgpod library......... NOT NEEDED" + echo "-- libgpod and gdk library......... NOT NEEDED" fi echo "" --- branches/extragear/kde3/libs/kipi-plugins/configure.in.in #919106:919107 @@ -234,7 +234,7 @@ KIPI_PLUGIN_PRE([htmlexport], [HTML Gallery], [xslt]) #KIPI_PLUGIN_PRE([imagesgallery], [Images Gallery]) # ??? KIPI_PLUGIN_PRE([imageviewer], [Viewer], [opengl]) -KIPI_PLUGIN_PRE([ipodexport], [iPod Export], [libgpod]) +KIPI_PLUGIN_PRE([ipodexport], [iPod Export], [libgpod] [gdk]) KIPI_PLUGIN_PRE([jpeglossless], [JPEG Lossless]) # Does it depend on tiff? KIPI_PLUGIN_PRE([kameraklient], [Kamera Klient], [gphoto]) KIPI_PLUGIN_PRE([metadataedit], [Metadata Editor]) @@ -329,7 +329,7 @@ if test "x$build_libgpod" != "xno"; then if test "$PKGCONFIGFOUND" = "yes" ; then - KDE_PKG_CHECK_MODULES(LIBGPOD, libgpod-1.0 >= 0.4.2 gobject-2.0, have_libgpod=yes,have_libgpod=no) + KDE_PKG_CHECK_MODULES(LIBGPOD, libgpod-1.0 >= 0.7.0 gobject-2.0, have_libgpod=yes,have_libgpod=no) if test "x$have_libgpod" = "xyes"; then AC_DEFINE(HAVE_LIBGPOD, 1, [have libgpod]) @@ -343,11 +343,41 @@ else AC_MSG_WARN([libgpod is required for the iPod export plugin.]) fi + fi fi #------------------------------------------------------------------ # +# Check for GDK - ipod export plugin +# +#------------------------------------------------------------------ + +have_gdk=no + +if test "x$build_libgpod" != "xno"; then + if test "$PKGCONFIGFOUND" = "yes" ; then + + KDE_PKG_CHECK_MODULES(GDK, gdk-2.0 >= 2.10.0, have_gdk=yes,have_gdk=no) + + if test "x$have_gdk" = "xyes"; then + AC_DEFINE(HAVE_GDK, 1, [have gdk]) + ac_cppflags_save=$CPPFLAGS + ac_cflags_save=$CFLAGS + ac_ldflags_save=$LDFLAGS + + CPPFLAGS="$CPPFLAGS $GDK_INCLUDES" + CFLAGS="$CFLAGS $GDK_CFLAGS" + LDFLAGS="$LDFLAGS $GDK_LIBS" + else + AC_MSG_WARN([GDK is required for the iPod export plugin.]) + fi + + fi +fi + +#------------------------------------------------------------------ +# # Check for libkcal - iCalendar support library # #------------------------------------------------------------------ --- branches/extragear/kde3/libs/kipi-plugins/ipodexport/Makefile.am #919106:919107 @@ -2,6 +2,7 @@ INCLUDES = $(KIPI_PLUGINS_COMMON_INCLUDE) \ $(LIBKIPI_CFLAGS) \ $(LIBGPOD_CFLAGS) \ + $(GDK_CFLAGS) \ $(all_includes) METASOURCES = AUTO @@ -17,7 +18,7 @@ kipiplugin_ipodexport_la_LIBADD = $(LIBKIPI_LIBS) $(LIB_KIO) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) -kipiplugin_ipodexport_la_LDFLAGS = -module $(KDE_PLUGIN) $(LIBGPOD_LIBS) $(all_libraries) +kipiplugin_ipodexport_la_LDFLAGS = -module $(KDE_PLUGIN) $(LIBGPOD_LIBS) $(GDK_LIBS) $(all_libraries) kde_services_DATA = kipiplugin_ipodexport.desktop --- branches/extragear/kde3/libs/kipi-plugins/ipodexport/ipodexportdialog.cpp #919106:919107 @@ -47,6 +47,10 @@ #include #endif +extern "C" { +#include +} + #define debug() kdDebug() using namespace IpodExport; @@ -344,9 +348,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 +369,9 @@ // QPixmap pix; // pix.convertFromImage( image ); // m_ipodPreview->setPixmap( pix ); + + // memory release + gdk_pixbuf_unref ( gpixbuf ); } void