summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@nokia.com>2010-10-18 07:51:15 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2010-10-20 11:56:28 (GMT)
commitb895d7af3a75cbbc2b14a993679538ed02190b40 (patch)
tree719b4cb2b051097dfea12e886f08554b7bd6d0d6 /src/corelib
parent4346b33024c76760752fc1dc4b46847883cd0453 (diff)
downloadQt-b895d7af3a75cbbc2b14a993679538ed02190b40.zip
Qt-b895d7af3a75cbbc2b14a993679538ed02190b40.tar.gz
Qt-b895d7af3a75cbbc2b14a993679538ed02190b40.tar.bz2
Lighthouse on OS X.
Reviewed-by: Jørgen
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/corelib.pro9
-rw-r--r--src/corelib/global/qfeatures.h10
-rw-r--r--src/corelib/global/qfeatures.txt2
-rw-r--r--src/corelib/global/qglobal.cpp9
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.cpp3
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents_p.h4
-rw-r--r--src/corelib/io/qfilesystemwatcher_kqueue.cpp4
-rw-r--r--src/corelib/io/qfilesystemwatcher_kqueue_p.h2
-rw-r--r--src/corelib/io/qfsfileengine.cpp2
-rw-r--r--src/corelib/io/qfsfileengine_unix.cpp8
-rw-r--r--src/corelib/kernel/qcore_mac_p.h8
-rw-r--r--src/corelib/thread/qthread_unix.cpp4
12 files changed, 49 insertions, 16 deletions
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro
index 88b9252..349b3d4 100644
--- a/src/corelib/corelib.pro
+++ b/src/corelib/corelib.pro
@@ -19,7 +19,14 @@ include(codecs/codecs.pri)
include(statemachine/statemachine.pri)
include(xml/xml.pri)
-!nacl:mac|darwin:LIBS_PRIVATE += -framework ApplicationServices
+!qpa:mac|darwin:LIBS_PRIVATE += -framework ApplicationServices
+qpa:mac|darwin {
+ contains(QT_CONFIG, coreservices) {
+ LIBS_PRIVATE += -framework CoreServices
+ } else {
+ LIBS_PRIVATE += -framework CoreFoundation
+ }
+}
mac:lib_bundle:DEFINES += QT_NO_DEBUG_PLUGIN_CHECK
win32:DEFINES-=QT_NO_CAST_TO_ASCII
diff --git a/src/corelib/global/qfeatures.h b/src/corelib/global/qfeatures.h
index b606843..9710079 100644
--- a/src/corelib/global/qfeatures.h
+++ b/src/corelib/global/qfeatures.h
@@ -523,11 +523,6 @@
#define QT_NO_FTP
#endif
-// Hyper Text Transfer Protocol
-#if !defined(QT_NO_HTTP) && (defined(QT_NO_HOSTINFO))
-#define QT_NO_HTTP
-#endif
-
// QInputContext
#if !defined(QT_NO_IM) && (defined(QT_NO_LIBRARY))
#define QT_NO_IM
@@ -583,6 +578,11 @@
#define QT_NO_GRAPHICSVIEW
#endif
+// Hyper Text Transfer Protocol
+#if !defined(QT_NO_HTTP) && (defined(QT_NO_HOSTINFO) || defined(QT_NO_NETWORKPROXY))
+#define QT_NO_HTTP
+#endif
+
// QMdiArea
#if !defined(QT_NO_MDIAREA) && (defined(QT_NO_SCROLLAREA))
#define QT_NO_MDIAREA
diff --git a/src/corelib/global/qfeatures.txt b/src/corelib/global/qfeatures.txt
index 4d938a9..f07fbd5 100644
--- a/src/corelib/global/qfeatures.txt
+++ b/src/corelib/global/qfeatures.txt
@@ -1050,7 +1050,7 @@ SeeAlso: ???
Feature: HTTP
Description: Supports HTTP file access.
Section: Networking
-Requires: HOSTINFO
+Requires: HOSTINFO NETWORKPROXY
Name: Hyper Text Transfer Protocol
SeeAlso: ???
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index a160010..eeeccd3 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -74,7 +74,7 @@
# include <envLib.h>
#endif
-#if defined(Q_CC_MWERKS) && defined(Q_OS_MACX)
+#if defined(Q_OS_MACX) && !defined(QT_NO_CORESERVICES)
#include <CoreServices/CoreServices.h>
#endif
@@ -1643,7 +1643,7 @@ static const unsigned int qt_one = 1;
const int QSysInfo::ByteOrder = ((*((unsigned char *) &qt_one) == 0) ? BigEndian : LittleEndian);
#endif
-#if !defined(QWS) && defined(Q_OS_MAC)
+#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
QT_BEGIN_INCLUDE_NAMESPACE
#include "private/qcore_mac_p.h"
@@ -1697,15 +1697,18 @@ Q_CORE_EXPORT void qt_mac_to_pascal_string(QString s, Str255 str, TextEncoding e
Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr) {
return QCFString(CFStringCreateWithPascalString(0, pstr, CFStringGetSystemEncoding()));
}
+#endif //!defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
-
+#if !defined(QWS) && defined(Q_OS_MAC)
static QSysInfo::MacVersion macVersion()
{
+#ifndef QT_NO_CORESERVICES
SInt32 gestalt_version;
if (Gestalt(gestaltSystemVersion, &gestalt_version) == noErr) {
return QSysInfo::MacVersion(((gestalt_version & 0x00F0) >> 4) + 2);
}
+#endif
return QSysInfo::MV_Unknown;
}
const QSysInfo::MacVersion QSysInfo::MacintoshVersion = macVersion();
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.cpp b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
index d3276bd..0f96792 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.cpp
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
@@ -45,6 +45,8 @@
#include "qfilesystemwatcher.h"
#include "qfilesystemwatcher_fsevents_p.h"
+#ifndef QT_NO_FILESYSTEMWATCHER
+
#include <qdebug.h>
#include <qfile.h>
#include <qdatetime.h>
@@ -487,3 +489,4 @@ void QFSEventsFileSystemWatcherEngine::run()
}
QT_END_NAMESPACE
+#endif //QT_NO_FILESYSTEMWATCHER
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents_p.h b/src/corelib/io/qfilesystemwatcher_fsevents_p.h
index b0462b6..c888c61 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents_p.h
+++ b/src/corelib/io/qfilesystemwatcher_fsevents_p.h
@@ -56,6 +56,8 @@
#include "qfilesystemwatcher_p.h"
+#ifndef QT_NO_FILESYSTEMWATCHER
+
#include <QtCore/qmutex.h>
#include <QtCore/qwaitcondition.h>
#include <QtCore/qthread.h>
@@ -123,6 +125,8 @@ private:
#endif
};
+#endif //QT_NO_FILESYSTEMWATCHER
+
#endif
QT_END_NAMESPACE
diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
index 378ad20..7960792 100644
--- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp
+++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
@@ -45,6 +45,8 @@
#include "qfilesystemwatcher_kqueue_p.h"
#include "private/qcore_unix_p.h"
+#ifndef QT_NO_FILESYSTEMWATCHER
+
#include <qdebug.h>
#include <qfile.h>
#include <qsocketnotifier.h>
@@ -343,4 +345,6 @@ process_next_event:
}
}
+#endif //QT_NO_FILESYSTEMWATCHER
+
QT_END_NAMESPACE
diff --git a/src/corelib/io/qfilesystemwatcher_kqueue_p.h b/src/corelib/io/qfilesystemwatcher_kqueue_p.h
index eda646b..edc20ae 100644
--- a/src/corelib/io/qfilesystemwatcher_kqueue_p.h
+++ b/src/corelib/io/qfilesystemwatcher_kqueue_p.h
@@ -60,6 +60,7 @@
#include <QtCore/qthread.h>
#include <QtCore/qvector.h>
+#ifndef QT_NO_FILESYSTEMWATCHER
struct kevent;
QT_BEGIN_NAMESPACE
@@ -92,4 +93,5 @@ private:
QT_END_NAMESPACE
+#endif //QT_NO_FILESYSTEMWATCHER
#endif // FILEWATCHER_KQUEUE_P_H
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index a1ffb81..90c6ea8 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -152,7 +152,7 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path)
// ... but Linux with uClibc does not have it
#if !defined(__UCLIBC__)
char *ret = 0;
-#if defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
// 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(path.toLocal8Bit().constData(), (char*)0);
diff --git a/src/corelib/io/qfsfileengine_unix.cpp b/src/corelib/io/qfsfileengine_unix.cpp
index d83f7ee..67bcf45 100644
--- a/src/corelib/io/qfsfileengine_unix.cpp
+++ b/src/corelib/io/qfsfileengine_unix.cpp
@@ -739,7 +739,7 @@ static bool _q_isSymbianHidden(const QString &path, bool isDir)
}
#endif
-#if !defined(QWS) && defined(Q_OS_MAC)
+#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
static bool _q_isMacHidden(const QString &path)
{
OSErr err = noErr;
@@ -824,7 +824,7 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
if (exists && (type & PermsMask))
ret |= d->getPermissions(type);
if (type & TypesMask) {
-#if !defined(QWS) && defined(Q_OS_MAC)
+#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
bool foundAlias = false;
{
FSRef fref;
@@ -878,7 +878,7 @@ QAbstractFileEngine::FileFlags QFSFileEngine::fileFlags(FileFlags type) const
} else {
QString baseName = fileName(BaseName);
if ((baseName.size() > 0 && baseName.at(0) == QLatin1Char('.'))
-# if !defined(QWS) && defined(Q_OS_MAC)
+# if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
|| _q_isMacHidden(d->filePath)
# endif
) {
@@ -1133,7 +1133,7 @@ QString QFSFileEngine::fileName(FileName file) const
return ret;
}
}
-#if !defined(QWS) && defined(Q_OS_MAC)
+#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
{
FSRef fref;
if (FSPathMakeRef((const UInt8 *)QFile::encodeName(QDir::cleanPath(d->filePath)).data(), &fref, 0) == noErr) {
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index 9591f08..22b6a36 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -68,7 +68,15 @@
# undef qDebug
#endif
+#if defined(QT_BUILD_QMAKE) || defined(QT_BOOTSTRAPPED)
#include <ApplicationServices/ApplicationServices.h>
+#else
+#include <CoreFoundation/CoreFoundation.h>
+#endif
+
+#ifndef QT_NO_CORESERVICES
+#include <CoreServices/CoreServices.h>
+#endif
#undef DEBUG
#ifdef OLD_DEBUG
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 20c6fb7..5eba09c 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -83,7 +83,9 @@
# define old_qDebug qDebug
# undef qDebug
# endif
+#ifndef QT_NO_CORESERVICES
# include <CoreServices/CoreServices.h>
+#endif //QT_NO_CORESERVICES
# ifdef old_qDebug
# undef qDebug
@@ -358,7 +360,7 @@ int QThread::idealThreadCount()
{
int cores = -1;
-#if defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(Q_WS_QPA)
// Mac OS X
cores = MPProcessorsScheduled();
#elif defined(Q_OS_HPUX)