From 1d01bc1e83560cb2fc4f9f7f00762ffa5134448a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 21 Oct 2011 09:55:40 +0200 Subject: corelib: Remove Q_WS-macros. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Q_WS_QPA is the only active code path after merging refactor, other Q_WS-macros are no longer used. Enable compilation without -qpa. - Remove Q_OS_MSDOS, Q_OS_OS2 - Remove Q_WS_QWS - Remove/replace definitions/conditionals of Q_WS_XX - Remove qpa branches from profiles - Replace Q_WS_MAC by Q_OS_MAC - Replace Q_WS_MAC && !Q_WS_QPA by Q_OS_MAC && !QT_NO_CORESERVICES - Similarly in profiles: mac:contains(QT_CONFIG, coreservices) - Replace Q_FS_FAT by Q_OS_WIN Change-Id: Icce5a6c55b052c8f72b3b979ddf31a4f388ea9c9 Reviewed-by: João Abecasis --- src/corelib/codecs/qtextcodec.cpp | 6 +- src/corelib/corelib.pro | 7 +- src/corelib/global/qglobal.cpp | 119 ++---------------------------- src/corelib/global/qglobal.h | 72 +----------------- src/corelib/global/qnamespace.h | 12 +-- src/corelib/global/qt_windows.h | 2 +- src/corelib/io/qdir.cpp | 10 +-- src/corelib/io/qfilesystemengine.cpp | 2 +- src/corelib/io/qfilesystemengine_p.h | 2 +- src/corelib/io/qfilesystemengine_unix.cpp | 20 +++-- src/corelib/io/qfilesystemengine_win.cpp | 6 +- src/corelib/io/qfilesystemmetadata_p.h | 4 +- src/corelib/io/qfsfileengine_win.cpp | 5 -- src/corelib/io/qsettings.cpp | 4 - src/corelib/io/qsettings_p.h | 2 - src/corelib/kernel/kernel.pri | 2 +- src/corelib/kernel/qcoreapplication.cpp | 4 +- src/corelib/kernel/qobject.cpp | 2 +- src/corelib/plugin/qfactoryloader.cpp | 2 +- src/corelib/plugin/qfactoryloader_p.h | 2 +- src/corelib/thread/qthread_unix.cpp | 2 +- src/corelib/tools/qdatetime.cpp | 2 +- src/corelib/tools/qrect.h | 3 - src/corelib/tools/qstring.cpp | 2 +- 24 files changed, 44 insertions(+), 250 deletions(-) diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index f28133be77..42fac98a71 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -74,7 +74,7 @@ # include "../../plugins/codecs/kr/qeuckrcodec.h" # include "../../plugins/codecs/tw/qbig5codec.h" # endif // QT_NO_ICONV -# if defined(Q_WS_X11) && !defined(QT_BOOTSTRAPPED) +# if defined(Q_OS_UNIX) && !defined(QT_BOOTSTRAPPED) # include "qfontlaocodec_p.h" # include "../../plugins/codecs/jp/qfontjpcodec.h" # endif @@ -756,7 +756,7 @@ static void setup() localeMapper = QSymbianTextCodec::init(); #endif -# if defined(Q_WS_X11) && !defined(QT_BOOTSTRAPPED) +# if defined(Q_OS_UNIX) && !defined(QT_BOOTSTRAPPED) // no font codecs when bootstrapping (void)new QFontLaoCodec; # if defined(QT_NO_ICONV) @@ -770,7 +770,7 @@ static void setup() (void)new QFontBig5hkscsCodec; (void)new QFontBig5Codec; # endif // QT_NO_ICONV && !QT_BOOTSTRAPPED -# endif // Q_WS_X11 +# endif // Q_OS_UNIX #if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY) diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 2388f53a9e..edb5ecb849 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -29,13 +29,12 @@ include(codecs/codecs.pri) include(statemachine/statemachine.pri) include(xml/xml.pri) -!qpa:mac|darwin:LIBS_PRIVATE += -framework ApplicationServices -qpa { +mac|darwin { contains(QT_CONFIG, coreservices) { + LIBS_PRIVATE += -framework ApplicationServices LIBS_PRIVATE += -framework CoreServices } -} else:mac|darwin { - LIBS_PRIVATE += -framework CoreFoundation + 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/qglobal.cpp b/src/corelib/global/qglobal.cpp index 452679c7d7..453c4a96a8 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -933,7 +933,7 @@ bool qSharedBuild() \endlist Some constants are defined only on certain platforms. You can use - the preprocessor symbols Q_WS_WIN and Q_WS_MAC to test that + the preprocessor symbols Q_OS_WIN and Q_OS_MAC to test that the application is compiled under Windows or Mac. \sa QLibraryInfo @@ -1118,51 +1118,6 @@ bool qSharedBuild() \sa SymbianVersion, WinVersion, MacVersion */ -/*! - \macro Q_WS_MAC - \relates - - Defined on Mac OS X. - - \sa Q_WS_WIN, Q_WS_X11, Q_WS_QWS, Q_WS_QPA, Q_WS_S60 -*/ - -/*! - \macro Q_WS_WIN - \relates - - Defined on Windows. - - \sa Q_WS_MAC, Q_WS_X11, Q_WS_QWS, Q_WS_QPA, Q_WS_S60 -*/ - -/*! - \macro Q_WS_X11 - \relates - - Defined on X11. - - \sa Q_WS_MAC, Q_WS_WIN, Q_WS_QWS, Q_WS_QPA, Q_WS_S60 -*/ - -/*! - \macro Q_WS_QWS - \relates - - Defined on Qt for Embedded Linux. - - \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_QPA, Q_WS_S60 -*/ - -/*! - \macro Q_WS_QPA - \relates - - Defined on Qt for Embedded Linux, Lite version. - - \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_QWS, Q_WS_S60 -*/ - /*! \macro Q_OS_DARWIN \relates @@ -1170,27 +1125,6 @@ bool qSharedBuild() Defined on Darwin OS (synonym for Q_OS_MAC). */ -/*! - \macro Q_OS_MSDOS - \relates - - Defined on MS-DOS and Windows. -*/ - -/*! - \macro Q_OS_OS2 - \relates - - Defined on OS/2. -*/ - -/*! - \macro Q_OS_OS2EMX - \relates - - Defined on XFree86 on OS/2 (not PM). -*/ - /*! \macro Q_OS_WIN32 \relates @@ -1520,15 +1454,6 @@ bool qSharedBuild() Defined on Symbian. */ -/*! - \macro Q_WS_S60 - \relates - - Defined on S60 with the Avkon UI framework. - - \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_QWS - */ - /*! \macro QT_DISABLE_DEPRECATED_BEFORE \relates @@ -1550,7 +1475,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_WS_QPA) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) QT_BEGIN_INCLUDE_NAMESPACE #include "private/qcore_mac_p.h" @@ -1562,51 +1487,19 @@ Q_CORE_EXPORT OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref) return FSPathMakeRef(reinterpret_cast(file.toUtf8().constData()), fsref, 0); } -// 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) -{ - FSRef fsref; - OSErr ret = qt_mac_create_fsref(file, &fsref); - if (ret == noErr) - ret = FSGetCatalogInfo(&fsref, kFSCatInfoNone, 0, 0, spec, 0); - return ret; -} - Q_CORE_EXPORT void qt_mac_to_pascal_string(QString s, Str255 str, TextEncoding encoding=0, int len=-1) { - if(len == -1) - len = s.length(); -#if 0 - UnicodeMapping mapping; - mapping.unicodeEncoding = CreateTextEncoding(kTextEncodingUnicodeDefault, - kTextEncodingDefaultVariant, - kUnicode16BitFormat); - mapping.otherEncoding = (encoding ? encoding : ); - mapping.mappingVersion = kUnicodeUseLatestMapping; - - UnicodeToTextInfo info; - OSStatus err = CreateUnicodeToTextInfo(&mapping, &info); - if(err != noErr) { - qDebug("Qt: internal: Unable to create pascal string '%s'::%d [%ld]", - s.left(len).latin1(), (int)encoding, err); - return; - } - const int unilen = len * 2; - const UniChar *unibuf = (UniChar *)s.unicode(); - ConvertFromUnicodeToPString(info, unilen, unibuf, str); - DisposeUnicodeToTextInfo(&info); -#else Q_UNUSED(encoding); + Q_UNUSED(len); CFStringGetPascalString(QCFString(s), str, 256, CFStringGetSystemEncoding()); -#endif } 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) +#endif // defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) -#if !defined(QWS) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) static QSysInfo::MacVersion macVersion() { @@ -1620,7 +1513,7 @@ static QSysInfo::MacVersion macVersion() } const QSysInfo::MacVersion QSysInfo::MacintoshVersion = macVersion(); -#elif defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINCE) +#elif defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINCE) QT_BEGIN_INCLUDE_NAMESPACE #include "qt_windows.h" diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index d72de75545..9780c2f96e 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -210,14 +210,6 @@ namespace QT_NAMESPACE {} # define QT_NO_GETIFADDRS #elif defined(__CYGWIN__) # define Q_OS_CYGWIN -#elif defined(MSDOS) || defined(_MSDOS) -# define Q_OS_MSDOS -#elif defined(__OS2__) -# if defined(__EMX__) -# define Q_OS_OS2EMX -# else -# define Q_OS_OS2 -# endif #elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__)) # define Q_OS_WIN32 # define Q_OS_WIN64 @@ -298,7 +290,7 @@ namespace QT_NAMESPACE {} # endif #endif -#if defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN) +#if defined(Q_OS_WIN) # undef Q_OS_UNIX #elif !defined(Q_OS_UNIX) # define Q_OS_UNIX @@ -854,54 +846,6 @@ namespace QT_NAMESPACE {} # endif #endif -/* - The window system, must be one of: (Q_WS_x) - - MACX - Mac OS X - MAC9 - Mac OS 9 - QWS - Qt for Embedded Linux - WIN32 - Windows - X11 - X Window System - S60 - Symbian S60 - PM - unsupported - WIN16 - unsupported -*/ - -#if defined (Q_WS_QPA) - -#elif defined(Q_OS_MSDOS) -# define Q_WS_WIN16 -# error "Qt requires Win32 and does not work with Windows 3.x" -#elif defined(_WIN32_X11_) -# define Q_WS_X11 -#elif defined(Q_OS_WIN32) -# define Q_WS_WIN32 -# if defined(Q_OS_WIN64) -# define Q_WS_WIN64 -# endif -#elif defined(Q_OS_WINCE) -# define Q_WS_WIN32 -# define Q_WS_WINCE -# if defined(Q_OS_WINCE_WM) -# define Q_WS_WINCE_WM -# endif -#elif defined(Q_OS_OS2) -# define Q_WS_PM -# error "Qt does not work with OS/2 Presentation Manager or Workplace Shell" -#elif defined(Q_OS_UNIX) -# if defined(Q_OS_SYMBIAN) -# if !defined(QT_NO_S60) -# define Q_WS_S60 -# endif -# elif !defined(Q_WS_QWS) && !defined(Q_WS_QPA) -# define Q_WS_X11 -# endif -#endif - -#if defined(Q_WS_WIN16) || defined(Q_WS_WIN32) || defined(Q_WS_WINCE) -# define Q_WS_WIN -#endif - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -1186,13 +1130,7 @@ Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max class QDataStream; -#if defined(Q_WS_MAC) -# ifndef QMAC_QMENUBAR_NO_EVENT -# define QMAC_QMENUBAR_NO_EVENT -# endif -#endif - -#if !defined(Q_WS_QWS) && !defined(QT_NO_COP) +#if !defined(QT_NO_COP) # define QT_NO_COP #endif @@ -2730,12 +2668,6 @@ QT_LICENSED_MODULE(DBus) # endif #endif -#if !(defined(Q_WS_WIN) && !defined(Q_WS_WINCE)) \ - && !(defined(Q_WS_X11) && !defined(QT_NO_FREETYPE)) \ - && !(defined(Q_WS_QPA)) -# define QT_NO_RAWFONT -#endif - namespace QtPrivate { //like std::enable_if template struct QEnableIf; diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 01de6807ed..ce842f36a3 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1395,16 +1395,10 @@ public: }; Q_DECLARE_FLAGS(MatchFlags, MatchFlag) -#if defined(Q_WS_MAC) - typedef void * HANDLE; -#elif defined(Q_WS_WIN) - typedef void *HANDLE; -#elif defined(Q_WS_X11) - typedef unsigned long HANDLE; -#elif defined(Q_WS_QWS) || defined(Q_WS_QPA) - typedef void * HANDLE; -#elif defined(Q_OS_SYMBIAN) +#if defined(Q_OS_SYMBIAN) typedef unsigned long int HANDLE; // equivalent to TUint32 +#else + typedef void * HANDLE; #endif typedef WindowFlags WFlags; diff --git a/src/corelib/global/qt_windows.h b/src/corelib/global/qt_windows.h index d0bde3189f..ba4041e765 100644 --- a/src/corelib/global/qt_windows.h +++ b/src/corelib/global/qt_windows.h @@ -139,7 +139,7 @@ #define CLEARTYPE_QUALITY 5 #endif -#ifdef Q_WS_WINCE +#ifdef Q_OS_WINCE #ifndef LR_DEFAULTSIZE #define LR_DEFAULTSIZE 0 #endif diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 68da6283cf..e7fdc4ad55 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -794,7 +794,7 @@ QString QDir::convertSeparators(const QString &pathName) */ QString QDir::toNativeSeparators(const QString &pathName) { -#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN) +#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) int i = pathName.indexOf(QLatin1Char('/')); if (i != -1) { QString n(pathName); @@ -827,7 +827,7 @@ QString QDir::toNativeSeparators(const QString &pathName) */ QString QDir::fromNativeSeparators(const QString &pathName) { -#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN) +#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) int i = pathName.indexOf(QLatin1Char('\\')); if (i != -1) { QString n(pathName); @@ -1763,12 +1763,8 @@ QFileInfoList QDir::drives() */ QChar QDir::separator() { -#if defined (Q_FS_FAT) || defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) +#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) return QLatin1Char('\\'); -#elif defined(Q_OS_UNIX) - return QLatin1Char('/'); -#elif defined (Q_OS_MAC) - return QLatin1Char(':'); #else return QLatin1Char('/'); #endif diff --git a/src/corelib/io/qfilesystemengine.cpp b/src/corelib/io/qfilesystemengine.cpp index 97669acd8c..72900ec033 100644 --- a/src/corelib/io/qfilesystemengine.cpp +++ b/src/corelib/io/qfilesystemengine.cpp @@ -267,7 +267,7 @@ void QFileSystemMetaData::fillFromStatBuf(const QT_STATBUF &statBuffer) // Attributes entryFlags |= QFileSystemMetaData::ExistsAttribute; size_ = statBuffer.st_size; -#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) \ +#if defined (Q_OS_MAC) && !defined(QT_NO_CORESERVICES) \ && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 if (statBuffer.st_flags & UF_HIDDEN) { entryFlags |= QFileSystemMetaData::HiddenAttribute; diff --git a/src/corelib/io/qfilesystemengine_p.h b/src/corelib/io/qfilesystemengine_p.h index 96a2019821..bbd4c4c020 100644 --- a/src/corelib/io/qfilesystemengine_p.h +++ b/src/corelib/io/qfilesystemengine_p.h @@ -76,7 +76,7 @@ public: static QString resolveGroupName(uint groupId); #endif -#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) static QString bundleName(const QFileSystemEntry &entry); #else static QString bundleName(const QFileSystemEntry &entry) { Q_UNUSED(entry) return QString(); } diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 966daba021..acc8c2c8cf 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE -#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) static inline bool _q_isMacHidden(const char *nativePath) { OSErr err; @@ -148,7 +148,7 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link, ret.chop(1); return QFileSystemEntry(ret); } -#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) { FSRef fref; if (FSPathMakeRef((const UInt8 *)QFile::encodeName(QDir::cleanPath(link.filePath())).data(), &fref, 0) == noErr) { @@ -305,7 +305,7 @@ QString QFileSystemEngine::resolveGroupName(uint groupId) return QString(); } -#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) //static QString QFileSystemEngine::bundleName(const QFileSystemEntry &entry) { @@ -325,20 +325,18 @@ QString QFileSystemEngine::bundleName(const QFileSystemEntry &entry) bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data, QFileSystemMetaData::MetaDataFlags what) { -#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) if (what & QFileSystemMetaData::BundleType) { if (!data.hasFlags(QFileSystemMetaData::DirectoryType)) what |= QFileSystemMetaData::DirectoryType; } -#endif - -#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) \ - && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 +# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 if (what & QFileSystemMetaData::HiddenAttribute) { // Mac OS >= 10.5: st_flags & UF_HIDDEN what |= QFileSystemMetaData::PosixStatFlags; } -#endif +# endif // MAC_OS_X_VERSION_MAX_ALLOWED... +#endif // defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) if (what & QFileSystemMetaData::PosixStatFlags) what |= QFileSystemMetaData::PosixStatFlags; @@ -399,7 +397,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM | QFileSystemMetaData::ExistsAttribute; } -#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) if (what & QFileSystemMetaData::AliasType) { if (entryExists) { @@ -445,7 +443,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM data.knownFlagsMask |= QFileSystemMetaData::HiddenAttribute; } -#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) if (what & QFileSystemMetaData::BundleType) { if (entryExists && data.isDirectory()) { QCFType path = CFStringCreateWithBytes(0, diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 3296bab580..9907ee8a17 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -975,15 +975,11 @@ QString QFileSystemEngine::rootPath() { #if defined(Q_OS_WINCE) QString ret = QLatin1String("/"); -#elif defined(Q_FS_FAT) +#else QString ret = QString::fromLatin1(qgetenv("SystemDrive").constData()); if (ret.isEmpty()) ret = QLatin1String("c:"); ret.append(QLatin1Char('/')); -#elif defined(Q_OS_OS2EMX) - char dir[4]; - _abspath(dir, QLatin1String("/"), _MAX_PATH); - QString ret(dir); #endif return ret; } diff --git a/src/corelib/io/qfilesystemmetadata_p.h b/src/corelib/io/qfilesystemmetadata_p.h index de5b00377b..64749e3889 100644 --- a/src/corelib/io/qfilesystemmetadata_p.h +++ b/src/corelib/io/qfilesystemmetadata_p.h @@ -106,7 +106,7 @@ public: #endif FileType = 0x00020000, DirectoryType = 0x00040000, -#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) BundleType = 0x00080000, AliasType = 0x08000000, #else @@ -266,7 +266,7 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QFileSystemMetaData::MetaDataFlags) -#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) inline bool QFileSystemMetaData::isBundle() const { return (entryFlags & BundleType); } inline bool QFileSystemMetaData::isAlias() const { return (entryFlags & AliasType); } #else diff --git a/src/corelib/io/qfsfileengine_win.cpp b/src/corelib/io/qfsfileengine_win.cpp index 8578402900..f2b3e5f534 100644 --- a/src/corelib/io/qfsfileengine_win.cpp +++ b/src/corelib/io/qfsfileengine_win.cpp @@ -575,11 +575,6 @@ QFileInfoList QFSFileEngine::drives() #if !defined(Q_OS_WINCE) #if defined(Q_OS_WIN32) quint32 driveBits = (quint32) GetLogicalDrives() & 0x3ffffff; -#elif defined(Q_OS_OS2EMX) - quint32 driveBits, cur; - if (DosQueryCurrentDisk(&cur, &driveBits) != NO_ERROR) - exit(1); - driveBits &= 0x3ffffff; #endif char driveName[] = "A:/"; diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 6d3fbfb592..37bd8c460d 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -1102,11 +1102,7 @@ static void initDefaultPaths(QMutexLocker *locker) if (env == 0) { userPath = homePath; userPath += QLatin1Char('/'); -#if defined(Q_WS_QWS) || defined(Q_WS_QPA) - userPath += QLatin1String("Settings"); -#else userPath += QLatin1String(".config"); -#endif } else if (*env == '/') { userPath = QFile::decodeName(env); } else { diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h index a87acc2c57..5d62c839a6 100644 --- a/src/corelib/io/qsettings_p.h +++ b/src/corelib/io/qsettings_p.h @@ -70,9 +70,7 @@ QT_BEGIN_NAMESPACE -#if defined(Q_WS_QWS) || defined(Q_WS_QPA) #define QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER -#endif // used in testing framework #define QSETTINGS_P_H_VERSION 3 diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri index aa8513fe8f..354bb4a9a0 100644 --- a/src/corelib/kernel/kernel.pri +++ b/src/corelib/kernel/kernel.pri @@ -82,7 +82,7 @@ wince*: { kernel/qfunctions_wince.h } -mac:!embedded:!qpa{ +mac { SOURCES += \ kernel/qcoreapplication_mac.cpp } diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 24d0ceef56..f7d1d3d506 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -172,7 +172,7 @@ CApaCommandLine* QCoreApplicationPrivate::symbianCommandLine() #endif -#if defined(Q_OS_WIN) || defined(Q_WS_MAC) +#if defined(Q_OS_WIN) || defined(Q_OS_MAC) extern QString qAppFileName(); #endif @@ -1968,7 +1968,7 @@ QString QCoreApplication::applicationFilePath() #if defined(Q_OS_WIN) d->cachedApplicationFilePath = QFileInfo(qAppFileName()).filePath(); return d->cachedApplicationFilePath; -#elif defined(Q_WS_MAC) +#elif defined(Q_OS_MAC) QString qAppFileName_str = qAppFileName(); if(!qAppFileName_str.isEmpty()) { QFileInfo fi(qAppFileName_str); diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 6c35a8e553..a50d5a92ce 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1342,7 +1342,7 @@ void QObject::moveToThread(QThread *targetThread) "Cannot move to target thread (%p)\n", currentData->thread, d->threadData->thread, targetData->thread); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC qWarning("On Mac OS X, you might be loading two sets of Qt binaries into the same process. " "Check that all plugins are compiled against the right Qt binaries. Export " "DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded."); diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index c175dcfe1b..749a7deddd 100644 --- a/src/corelib/plugin/qfactoryloader.cpp +++ b/src/corelib/plugin/qfactoryloader.cpp @@ -225,7 +225,7 @@ QObject *QFactoryLoader::instance(const QString &key) const return 0; } -#ifdef Q_WS_X11 +#if defined(Q_OS_UNIX) && !defined (Q_OS_MAC) QLibraryPrivate *QFactoryLoader::library(const QString &key) const { Q_D(const QFactoryLoader); diff --git a/src/corelib/plugin/qfactoryloader_p.h b/src/corelib/plugin/qfactoryloader_p.h index e90ebf66c3..75d40f8c3f 100644 --- a/src/corelib/plugin/qfactoryloader_p.h +++ b/src/corelib/plugin/qfactoryloader_p.h @@ -77,7 +77,7 @@ public: QStringList keys() const; QObject *instance(const QString &key) const; -#ifdef Q_WS_X11 +#if defined(Q_OS_UNIX) && !defined (Q_OS_MAC) QLibraryPrivate *library(const QString &key) const; #endif diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 839a396ac1..46bc641d16 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -361,7 +361,7 @@ int QThread::idealThreadCount() { int cores = -1; -#if defined(Q_OS_MAC) && !defined(Q_WS_QPA) +#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES) // Mac OS X cores = MPProcessorsScheduled(); #elif defined(Q_OS_HPUX) diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 3d3bc55d71..3c8848ba0f 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -69,7 +69,7 @@ # define QDTPDEBUGN if (false) qDebug #endif -#if defined(Q_WS_MAC) +#if defined(Q_OS_MAC) #include #endif diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h index 5d6db9867e..58221f4739 100644 --- a/src/corelib/tools/qrect.h +++ b/src/corelib/tools/qrect.h @@ -146,9 +146,6 @@ public: friend Q_CORE_EXPORT_INLINE bool operator!=(const QRect &, const QRect &); private: -#if defined(Q_WS_X11) - friend void qt_setCoords(QRect *r, int xp1, int yp1, int xp2, int yp2); -#endif // ### Qt 5; remove the ifdef and just have the same order on all platforms. #if defined(Q_OS_MAC) int y1; diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 9278c7b97f..8e31afbee8 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -3668,7 +3668,7 @@ QByteArray QString::toAscii() const return toLatin1(); } -#if !defined(Q_WS_MAC) && defined(Q_OS_UNIX) +#if !defined(Q_OS_MAC) && defined(Q_OS_UNIX) static QByteArray toLocal8Bit_helper(const QChar *data, int length) { #ifndef QT_NO_TEXTCODEC -- cgit v1.2.3