diff options
author | Ian Dean <ian@mediator-software.com> | 2012-07-19 06:02:56 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-18 09:09:00 (GMT) |
commit | b3c21d93f66617b87b341911d329c0b1ad6af485 (patch) | |
tree | aee75fa9e661cc33916b3ef6c01de7217a8b4676 /src/corelib/io | |
parent | c14694621aab2e7df13830f80621fb5680b432e4 (diff) | |
download | Qt-b3c21d93f66617b87b341911d329c0b1ad6af485.zip Qt-b3c21d93f66617b87b341911d329c0b1ad6af485.tar.gz Qt-b3c21d93f66617b87b341911d329c0b1ad6af485.tar.bz2 |
Refactor coreservices -> ios & QT_NO_CORESERVICES -> Q_OS_IOS
Similar work was done in Qt5 in Change Id3b02316
Change-Id: I392d2a5bfffb9a335f28d5dbc5ea27b800fc4487
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_fsevents.cpp | 24 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_fsevents_p.h | 4 | ||||
-rw-r--r-- | src/corelib/io/qprocess.cpp | 4 | ||||
-rw-r--r-- | src/corelib/io/qprocess_unix.cpp | 4 |
5 files changed, 19 insertions, 19 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 4191f4d..da9c624 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -180,7 +180,7 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry, return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath())); #else char *ret = 0; -# if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) +# if defined(Q_OS_MAC) && !defined(Q_OS_IOS) // Mac OS X 10.5.x doesn't support the realpath(X,0) extension we use here. if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) { ret = realpath(entry.nativeFilePath().constData(), (char*)0); diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.cpp b/src/corelib/io/qfilesystemwatcher_fsevents.cpp index 1788254..4265991 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents.cpp +++ b/src/corelib/io/qfilesystemwatcher_fsevents.cpp @@ -57,7 +57,7 @@ #include <sys/types.h> #include <CoreFoundation/CFRunLoop.h> #include <CoreFoundation/CFUUID.h> -#if !defined( QT_NO_CORESERVICES ) +#if !defined(Q_OS_IOS) #include <CoreServices/CoreServices.h> #endif #include <AvailabilityMacros.h> @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) // Static operator overloading so for the sake of some convieniece. // They only live in this compilation unit to avoid polluting Qt in general. static bool operator==(const struct ::timespec &left, const struct ::timespec &right) @@ -154,7 +154,7 @@ QFSEventsFileSystemWatcherEngine::QFSEventsFileSystemWatcherEngine() QFSEventsFileSystemWatcherEngine::~QFSEventsFileSystemWatcherEngine() { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) // I assume that at this point, QFileSystemWatcher has already called stop // on me, so I don't need to invalidate or stop my stream, simply // release it. @@ -173,7 +173,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths, QStringList *files, QStringList *directories) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) stop(); wait(); QMutexLocker locker(&mutex); @@ -259,7 +259,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths, void QFSEventsFileSystemWatcherEngine::warmUpFSEvents() { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) // This function assumes that the mutex has already been grabbed before calling it. // It exits with the mutex still locked (Q_ASSERT(mutex.isLocked()) ;-). start(); @@ -271,7 +271,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat QStringList *files, QStringList *directories) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) stop(); wait(); QMutexLocker locker(&mutex); @@ -338,7 +338,7 @@ QStringList QFSEventsFileSystemWatcherEngine::removePaths(const QStringList &pat #endif } -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) void QFSEventsFileSystemWatcherEngine::updateList(PathInfoList &list, bool directory, bool emitSignals) { PathInfoList::iterator End = list.end(); @@ -398,7 +398,7 @@ void QFSEventsFileSystemWatcherEngine::fseventsCallback(ConstFSEventStreamRef , const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId []) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) QFSEventsFileSystemWatcherEngine *watcher = static_cast<QFSEventsFileSystemWatcherEngine *>(clientCallBackInfo); QMutexLocker locker(&watcher->mutex); CFArrayRef paths = static_cast<CFArrayRef>(eventPaths); @@ -433,7 +433,7 @@ void QFSEventsFileSystemWatcherEngine::fseventsCallback(ConstFSEventStreamRef , void QFSEventsFileSystemWatcherEngine::stop() { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) QMutexLocker locker(&mutex); stopFSStream(fsStream); if (threadsRunLoop) { @@ -445,13 +445,13 @@ void QFSEventsFileSystemWatcherEngine::stop() void QFSEventsFileSystemWatcherEngine::updateFiles() { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) QMutexLocker locker(&mutex); updateHash(filePathInfoHash); updateHash(dirPathInfoHash); if (filePathInfoHash.isEmpty() && dirPathInfoHash.isEmpty()) { // Everything disappeared before we got to start, don't bother. -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) // Code duplicated from stop(), with the exception that we // don't wait on waitForStop here. Doing this will lead to // a deadlock since this function is called from the worker @@ -469,7 +469,7 @@ void QFSEventsFileSystemWatcherEngine::updateFiles() void QFSEventsFileSystemWatcherEngine::run() { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) threadsRunLoop = CFRunLoopGetCurrent(); FSEventStreamScheduleWithRunLoop(fsStream, threadsRunLoop, kCFRunLoopDefaultMode); bool startedOK = FSEventStreamStart(fsStream); diff --git a/src/corelib/io/qfilesystemwatcher_fsevents_p.h b/src/corelib/io/qfilesystemwatcher_fsevents_p.h index f30e326..26c9cac 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents_p.h +++ b/src/corelib/io/qfilesystemwatcher_fsevents_p.h @@ -74,7 +74,7 @@ typedef uint64_t FSEventStreamEventId; QT_BEGIN_NAMESPACE -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(QT_NO_CORESERVICES) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) // Yes, I use a stat64 element here. QFileInfo requires too much knowledge about implementation // details to be used as a long-standing record. Since I'm going to have to store this information, I can // do the stat myself too. @@ -117,7 +117,7 @@ private: QMutex mutex; QWaitCondition waitCondition; QWaitCondition waitForStop; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined( QT_NO_CORESERVICES ) +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 && !defined(Q_OS_IOS) PathHash filePathInfoHash; PathHash dirPathInfoHash; void updateHash(PathHash &pathHash); diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 65cb580..c93077a 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -2256,10 +2256,10 @@ bool QProcess::startDetached(const QString &program) } QT_BEGIN_INCLUDE_NAMESPACE -#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) +#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) # include <crt_externs.h> # define environ (*_NSGetEnviron()) -#elif defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) || (defined(Q_OS_MAC) && defined(QT_NO_CORESERVICES)) +#elif defined(Q_OS_WINCE) || defined(Q_OS_SYMBIAN) || (defined(Q_OS_MAC) && defined(Q_OS_IOS)) static char *qt_empty_environ[] = { 0 }; #define environ qt_empty_environ #elif !defined(Q_OS_WIN) diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 3f080d7..0e069a3 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -459,7 +459,7 @@ bool QProcessPrivate::createChannel(Channel &channel) } QT_BEGIN_INCLUDE_NAMESPACE -#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) +#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) # include <crt_externs.h> # define environ (*_NSGetEnviron()) #else @@ -470,7 +470,7 @@ QT_END_INCLUDE_NAMESPACE QProcessEnvironment QProcessEnvironment::systemEnvironment() { QProcessEnvironment env; -#if !defined(Q_OS_MAC) || !defined(QT_NO_CORESERVICES) +#if !defined(Q_OS_IOS) const char *entry; for (int count = 0; (entry = environ[count]); ++count) { const char *equal = strchr(entry, '='); |