Detect libimobiledevice 1.1.2 and use its new "udid" field instead of "uuid".

This commit is contained in:
David Sansome 2012-03-27 21:24:38 +01:00
parent f98616b60b
commit 119c9c27ac
3 changed files with 11 additions and 0 deletions

View File

@ -25,6 +25,10 @@ if (QT_VERSION_MINOR GREATER 5)
endif(QT_VERSION_MINOR GREATER 7)
endif(QT_VERSION_MINOR GREATER 5)
if(ENABLE_IMOBILEDEVICE AND IMOBILEDEVICE_VERSION VERSION_GREATER 1.1.1)
set(IMOBILEDEVICE_USES_UDIDS ON)
endif()
include_directories(${CMAKE_BINARY_DIR})
include_directories(${GLIB_INCLUDE_DIRS})
include_directories(${LIBXML_INCLUDE_DIRS})
@ -1079,6 +1083,7 @@ if(HAVE_IMOBILEDEVICE)
${USBMUXD_LIBRARIES}
gstafcsrc
)
link_directories(${IMOBILEDEVICE_LIBRARY_DIRS})
link_directories(${USBMUXD_LIBRARY_DIRS})
endif(HAVE_IMOBILEDEVICE)

View File

@ -39,6 +39,7 @@
#cmakedefine HAVE_SPOTIFY
#cmakedefine HAVE_STATIC_SQLITE
#cmakedefine HAVE_WIIMOTEDEV
#cmakedefine IMOBILEDEVICE_USES_UDIDS
#cmakedefine LEOPARD
#cmakedefine SNOW_LEOPARD
#cmakedefine USE_INSTALL_PREFIX

View File

@ -1,3 +1,4 @@
#include "config.h"
#include "ilister.h"
#include "imobiledeviceconnection.h"
@ -17,7 +18,11 @@ void iLister::Init() {
void iLister::EventCallback(const idevice_event_t* event, void* context) {
iLister* me = reinterpret_cast<iLister*>(context);
#ifdef IMOBILEDEVICE_USES_UDIDS
const char* uuid = event->udid;
#else
const char* uuid = event->uuid;
#endif
switch (event->event) {
case IDEVICE_DEVICE_ADD: