Ios: Make it the plugin compilable (but not functional) outside Mac

Change-Id: I1149ce410f2875c6ad8bd0d62c23bb6181f4c1ac
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hjk
2013-10-11 13:55:45 +02:00
parent e96e77690d
commit f50ffd614c
3 changed files with 13 additions and 11 deletions

View File

@@ -5,7 +5,7 @@ include(../../qtcreatorplugin.pri)
QT += xml network QT += xml network
LIBS += -framework CoreFoundation -framework IOKit macx: LIBS += -framework CoreFoundation -framework IOKit
HEADERS += \ HEADERS += \
iosconstants.h \ iosconstants.h \

View File

@@ -39,15 +39,18 @@
#include <QVariantMap> #include <QVariantMap>
#include <QMessageBox> #include <QMessageBox>
#ifdef Q_OS_MAC
#include <IOKit/IOKitLib.h> #include <IOKit/IOKitLib.h>
#include <IOKit/usb/IOUSBLib.h> #include <IOKit/usb/IOUSBLib.h>
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
#endif
using namespace ProjectExplorer; using namespace ProjectExplorer;
static bool debugDeviceDetection = false; static bool debugDeviceDetection = false;
namespace { #ifdef Q_OS_MAC
QString CFStringRef2QString(CFStringRef s) static QString CFStringRef2QString(CFStringRef s)
{ {
unsigned char buf[250]; unsigned char buf[250];
CFIndex len = CFStringGetLength(s); CFIndex len = CFStringGetLength(s);
@@ -67,8 +70,7 @@ QString CFStringRef2QString(CFStringRef s)
delete[] bigBuf; delete[] bigBuf;
return res; return res;
} }
#endif
}
namespace Ios { namespace Ios {
namespace Internal { namespace Internal {
@@ -349,6 +351,7 @@ void IosDeviceManager::infoGathererFinished(IosToolHandler *gatherer)
gatherer->deleteLater(); gatherer->deleteLater();
} }
#ifdef Q_OS_MAC
namespace { namespace {
io_iterator_t gAddedIter; io_iterator_t gAddedIter;
io_iterator_t gRemovedIter; io_iterator_t gRemovedIter;
@@ -418,9 +421,11 @@ void deviceDisconnectedCallback(void *refCon, io_iterator_t iterator)
} // extern C } // extern C
} // anonymous namespace } // anonymous namespace
#endif
void IosDeviceManager::monitorAvailableDevices() void IosDeviceManager::monitorAvailableDevices()
{ {
#ifdef Q_OS_MAC
CFMutableDictionaryRef matchingDictionary = CFMutableDictionaryRef matchingDictionary =
IOServiceMatching("IOUSBDevice" ); IOServiceMatching("IOUSBDevice" );
{ {
@@ -469,7 +474,7 @@ void IosDeviceManager::monitorAvailableDevices()
// Iterate once to get already-present devices and arm the notification // Iterate once to get already-present devices and arm the notification
deviceConnectedCallback(NULL, gAddedIter); deviceConnectedCallback(NULL, gAddedIter);
deviceDisconnectedCallback(NULL, gRemovedIter); deviceDisconnectedCallback(NULL, gRemovedIter);
#endif
} }

View File

@@ -48,11 +48,8 @@ SUBDIRS = \
todo \ todo \
qnx \ qnx \
clearcase \ clearcase \
baremetal baremetal \
ios
macx {
SUBDIRS += ios
}
isEmpty(QBS_INSTALL_DIR): QBS_INSTALL_DIR = $$(QBS_INSTALL_DIR) isEmpty(QBS_INSTALL_DIR): QBS_INSTALL_DIR = $$(QBS_INSTALL_DIR)
exists(../shared/qbs/qbs.pro)|!isEmpty(QBS_INSTALL_DIR): \ exists(../shared/qbs/qbs.pro)|!isEmpty(QBS_INSTALL_DIR): \