summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorIan Dean <ian@mediator-software.com>2012-07-19 06:02:56 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-09-18 09:09:00 (GMT)
commitb3c21d93f66617b87b341911d329c0b1ad6af485 (patch)
treeaee75fa9e661cc33916b3ef6c01de7217a8b4676 /src/corelib
parentc14694621aab2e7df13830f80621fb5680b432e4 (diff)
downloadQt-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')
-rw-r--r--src/corelib/corelib.pro2
-rw-r--r--src/corelib/global/qglobal.cpp4
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp2
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.cpp24
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents_p.h4
-rw-r--r--src/corelib/io/qprocess.cpp4
-rw-r--r--src/corelib/io/qprocess_unix.cpp4
-rw-r--r--src/corelib/kernel/qcore_mac.cpp4
-rw-r--r--src/corelib/kernel/qcore_mac_p.h6
-rw-r--r--src/corelib/thread/qthread_unix.cpp4
-rw-r--r--src/corelib/tools/qlocale_mac.mm2
-rw-r--r--src/corelib/tools/qpoint.h2
12 files changed, 31 insertions, 31 deletions
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index d7306e0..ec0467d 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -21,7 +21,7 @@ include(xml/xml.pri)
!qpa:mac|darwin:LIBS_PRIVATE += -framework ApplicationServices
qpa {
- contains(QT_CONFIG, coreservices) {
+ !ios {
LIBS_PRIVATE += -framework CoreServices -framework Security
}
} else:mac|darwin {
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index f119f2b..71fc6c9 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -74,7 +74,7 @@
# include <envLib.h>
#endif
-#if defined(Q_OS_MACX) && !defined(QT_NO_CORESERVICES)
+#if defined(Q_OS_MACX) && !defined(Q_OS_IOS)
#include <CoreServices/CoreServices.h>
#endif
@@ -1661,7 +1661,7 @@ QT_END_INCLUDE_NAMESPACE
static QSysInfo::MacVersion macVersion()
{
-#ifndef QT_NO_CORESERVICES
+#if !defined(Q_OS_IOS)
SInt32 gestalt_version;
if (Gestalt(gestaltSystemVersion, &gestalt_version) == noErr) {
return QSysInfo::MacVersion(((gestalt_version & 0x00F0) >> 4) + 2);
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, '=');
diff --git a/src/corelib/kernel/qcore_mac.cpp b/src/corelib/kernel/qcore_mac.cpp
index cf2730b..25170d5 100644
--- a/src/corelib/kernel/qcore_mac.cpp
+++ b/src/corelib/kernel/qcore_mac.cpp
@@ -87,7 +87,7 @@ QCFString::operator CFStringRef() const
}
-#ifndef QT_NO_CORESERVICES
+#if !defined(Q_OS_IOS)
void qt_mac_to_pascal_string(const QString &s, Str255 str, TextEncoding encoding, int len)
{
if(len == -1)
@@ -136,6 +136,6 @@ OSErr qt_mac_create_fsspec(const QString &file, FSSpec *spec)
ret = FSGetCatalogInfo(&fsref, kFSCatInfoNone, 0, 0, spec, 0);
return ret;
}
-#endif // QT_NO_CORESERVICES
+#endif // !defined(Q_OS_IOS)
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index 0124ee9..df579cd 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -74,7 +74,7 @@
#include <CoreFoundation/CoreFoundation.h>
#endif
-#ifndef QT_NO_CORESERVICES
+#if !defined(Q_OS_IOS)
#include <CoreServices/CoreServices.h>
#endif
@@ -149,14 +149,14 @@ private:
};
-#ifndef QT_NO_CORESERVICES
+#if !defined(Q_OS_IOS)
Q_CORE_EXPORT void qt_mac_to_pascal_string(const QString &s, Str255 str, TextEncoding encoding = 0, int len = -1);
Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr);
Q_CORE_EXPORT OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref);
// Don't use this function, it won't work in 10.5 (Leopard) and up
Q_CORE_EXPORT OSErr qt_mac_create_fsspec(const QString &file, FSSpec *spec);
-#endif // QT_NO_CORESERVICES
+#endif // !defined(Q_OS_IOS)
QT_END_NAMESPACE
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index e4eeb6d..df175d3 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -83,9 +83,9 @@
# define old_qDebug qDebug
# undef qDebug
# endif
-#ifndef QT_NO_CORESERVICES
+#if !defined(Q_OS_IOS)
# include <CoreServices/CoreServices.h>
-#endif //QT_NO_CORESERVICES
+#endif // !defined(Q_OS_IOS)
# ifdef old_qDebug
# undef qDebug
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm
index c08148e..64d998c 100644
--- a/src/corelib/tools/qlocale_mac.mm
+++ b/src/corelib/tools/qlocale_mac.mm
@@ -345,7 +345,7 @@ static QString macFormatCurrency(const QSystemLocale::CurrencyToStringArgument &
static QVariant macQuoteString(QSystemLocale::QueryType type, const QStringRef &str)
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 && !defined(QT_NO_CORESERVICES)
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 && !defined(Q_OS_IOS)
if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_6)
return QVariant();
diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h
index 1a6db69..93e94d7 100644
--- a/src/corelib/tools/qpoint.h
+++ b/src/corelib/tools/qpoint.h
@@ -93,7 +93,7 @@ public:
private:
friend class QTransform;
// ### Qt 5; remove the ifdef and just have the same order on all platforms.
-#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
+#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
int yp;
int xp;
#else