linamh/media-sound/amarok/files/amarok-ipod.patch

160 lines
5.1 KiB
Diff
Raw Normal View History

--- cmake/modules/FindIpod.cmake 2009-01-06 13:48:28.000000000 +0100
+++ cmake/modules/FindIpod.cmake 2009-02-10 18:18:23.000000000 +0100
@@ -2,45 +2,35 @@
# Once done this will define
#
# IPOD_FOUND - system has libgpod
-# IPOD_INCLUDE_DIR - the libgpod include directory
+# IPOD_INCLUDE_DIRS - the libgpod include directory
# IPOD_LIBRARIES - Link these to use libgpod
-# IPOD_DEFINITIONS - Compiler switches required for using libgpod
+# IPOD_CFLAGS - Compiler switches required for using libgpod
+# IPOD_VERSION - Version number of libgpod
#
-if (IPOD_INCLUDE_DIR AND IPOD_LIBRARIES)
+if (IPOD_INCLUDE_DIRS AND IPOD_LIBRARIES)
# in cache already
SET(IPOD_FOUND TRUE)
-else (IPOD_INCLUDE_DIR AND IPOD_LIBRARIES)
+else (IPOD_INCLUDE_DIRS AND IPOD_LIBRARIES)
if(NOT WIN32)
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
- INCLUDE(UsePkgConfig)
-
- PKGCONFIG(libgpod-1.0 _IPODIncDir _IPODLinkDir _IPODLinkFlags _IPODCflags)
-
- set(IPOD_DEFINITIONS ${_IPODCflags})
+ find_package(PkgConfig)
+ PKG_SEARCH_MODULE(IPOD libgpod-1.0)
+
endif(NOT WIN32)
+ IF (IPOD_FOUND)
+ IF (NOT IPOD_FIND_QUIETLY)
+ MESSAGE(STATUS "Found libgpod-1 ${IPOD_VERSION}")
+ ENDIF (NOT IPOD_FIND_QUIETLY)
+ ELSE (IPOD_FOUND)
+ IF (IPOD_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could NOT find libgpod-1, check FindPkgConfig output above!")
+ ENDIF (IPOD_FIND_REQUIRED)
+ ENDIF (IPOD_FOUND)
+
+ MARK_AS_ADVANCED(IPOD_INCLUDE_DIRS)
- FIND_PATH(IPOD_INCLUDE_DIR gpod/itdb.h /usr/include/gpod-1.0
- ${_IPODIncDir}
- )
-
- FIND_LIBRARY(IPOD_LIBRARIES NAMES gpod
- PATHS
- ${_IPODLinkDir}
- )
-
- if (IPOD_INCLUDE_DIR AND IPOD_LIBRARIES)
- SET(IPOD_FOUND TRUE)
- else (IPOD_INCLUDE_DIR AND IPOD_LIBRARIES)
- SET(IPOD_FOUND_FALSE)
- endif (IPOD_INCLUDE_DIR AND IPOD_LIBRARIES)
-
- include(FindPackageHandleStandardArgs)
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ipod DEFAULT_MSG IPOD_INCLUDE_DIR IPOD_LIBRARIES )
-
- MARK_AS_ADVANCED(IPOD_INCLUDE_DIR IPOD_LIBRARIES)
-
-endif (IPOD_INCLUDE_DIR AND IPOD_LIBRARIES)
+endif (IPOD_INCLUDE_DIRS AND IPOD_LIBRARIES)
--- src/collection/ipodcollection/CMakeLists.txt 2009-01-06 13:49:32.000000000 +0100
+++ src/collection/ipodcollection/CMakeLists.txt 2009-02-10 22:22:01.000000000 +0100
@@ -17,7 +17,7 @@
handler
${GLIB2_INCLUDE_DIR}
${GDK_INCLUDE_DIR}
- ${IPOD_INCLUDE_DIR}
+ ${IPOD_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}/../..
${AMAROK_COLLECTION_SUPPORT_DIR}
${KDE4_INCLUDE_DIR}
--- src/collection/ipodcollection/handler/IpodHandler.cpp 2009-01-06 13:49:32.000000000 +0100
+++ src/collection/ipodcollection/handler/IpodHandler.cpp 2009-02-10 18:00:09.000000000 +0100
@@ -1339,73 +1339,12 @@
QFileInfo tempImageFileInfo( tempImageFile ); // get info for path
QString tempImagePath = tempImageFileInfo.absoluteFilePath(); // path
- Itdb_Thumb *thumb = NULL;
GdkPixbuf *gpixbuf = NULL;
- QString thumbPath;
// pull image out of ipod
- if( ipodtrack->has_artwork == 0x01 )
- {
- // try small first
-
- thumb = itdb_artwork_get_thumb_by_type ( ipodtrack->artwork, ITDB_THUMB_COVER_SMALL );
-
- // then large if needed
- if( thumb == NULL)
- {
- thumb = itdb_artwork_get_thumb_by_type ( ipodtrack->artwork, ITDB_THUMB_COVER_LARGE );
- }
-
- if( thumb != NULL)
- {
- gpixbuf = (GdkPixbuf*) itdb_thumb_get_gdk_pixbuf( m_device, thumb );
- }
- else
- {
- GList *thumbs = ipodtrack->artwork->thumbnails;
-
- for(; thumbs; thumbs = thumbs->next)
- {
- Itdb_Thumb *curThumb = ( Itdb_Thumb * )thumbs->data;
- if( curThumb == NULL)
- continue;
-
- switch( curThumb->type )
- {
- case ITDB_THUMB_PHOTO_SMALL:
- break;
- case ITDB_THUMB_PHOTO_LARGE:
- break;
- case ITDB_THUMB_PHOTO_FULL_SCREEN:
- break;
- case ITDB_THUMB_PHOTO_TV_SCREEN:
- break;
- case ITDB_THUMB_COVER_XLARGE:
- break;
- case ITDB_THUMB_COVER_MEDIUM:
- break;
- case ITDB_THUMB_COVER_SMEDIUM:
- break;
- case ITDB_THUMB_COVER_XSMALL:
- break;
-
- default:
- break;
- }
-
- thumb = curThumb;
- break;
-
- }
-
- if( thumb != NULL)
- {
- thumbPath = QString::fromUtf8( itdb_thumb_get_filename( m_device, thumb ) );
- gpixbuf = (GdkPixbuf*) itdb_thumb_get_gdk_pixbuf( m_device, thumb );
- }
- }
- }
+ if( ipodtrack->has_artwork == 0x01 ) // 0x01 = true ; 0x02 = false
+ gpixbuf = (GdkPixbuf*) itdb_artwork_get_pixbuf( m_device, ipodtrack->artwork, 50, 50 );
if(gpixbuf != NULL)
{