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/global/qglobal.cpp | 119 +++-------------------------------------- 1 file changed, 6 insertions(+), 113 deletions(-) (limited to 'src/corelib/global/qglobal.cpp') 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" -- cgit v1.2.3