diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2011-10-21 09:55:40 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-24 11:04:04 +0200 |
commit | 1d01bc1e83560cb2fc4f9f7f00762ffa5134448a (patch) | |
tree | 04bd3d0fa16ce4515360f9c65bec9cffa370749f /src/corelib/global | |
parent | ccf27301e04addef0ed0cb6c7e832216cc3c12a8 (diff) |
corelib: Remove Q_WS-macros.
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 <joao.abecasis@nokia.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 119 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 72 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.h | 12 | ||||
-rw-r--r-- | src/corelib/global/qt_windows.h | 2 |
4 files changed, 12 insertions, 193 deletions
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 @@ -1119,51 +1119,6 @@ bool qSharedBuild() */ /*! - \macro Q_WS_MAC - \relates <QtGlobal> - - 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 <QtGlobal> - - Defined on Windows. - - \sa Q_WS_MAC, Q_WS_X11, Q_WS_QWS, Q_WS_QPA, Q_WS_S60 -*/ - -/*! - \macro Q_WS_X11 - \relates <QtGlobal> - - Defined on X11. - - \sa Q_WS_MAC, Q_WS_WIN, Q_WS_QWS, Q_WS_QPA, Q_WS_S60 -*/ - -/*! - \macro Q_WS_QWS - \relates <QtGlobal> - - 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 <QtGlobal> - - 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 <QtGlobal> @@ -1171,27 +1126,6 @@ bool qSharedBuild() */ /*! - \macro Q_OS_MSDOS - \relates <QtGlobal> - - Defined on MS-DOS and Windows. -*/ - -/*! - \macro Q_OS_OS2 - \relates <QtGlobal> - - Defined on OS/2. -*/ - -/*! - \macro Q_OS_OS2EMX - \relates <QtGlobal> - - Defined on XFree86 on OS/2 (not PM). -*/ - -/*! \macro Q_OS_WIN32 \relates <QtGlobal> @@ -1521,15 +1455,6 @@ bool qSharedBuild() */ /*! - \macro Q_WS_S60 - \relates <QtGlobal> - - 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 <QtGlobal> @@ -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<const UInt8 *>(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 <bool B, typename T = void> 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 |