OSDN Git Service

get rid of QSysInfo class [ci reset]
authorIvailo Monev <xakepa10@gmail.com>
Fri, 6 Aug 2021 20:57:53 +0000 (23:57 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Fri, 6 Aug 2021 20:58:05 +0000 (23:58 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
20 files changed:
CMakeLists.txt
package/freebsd/pkg-plist
package/netbsd/PLIST.common
package/openbsd/pkg/PLIST
scripts/incfsck.py
scripts/namefsck.py
src/core/global/qglobal.cpp
src/core/global/qglobal.h
src/core/global/qlibraryinfo.cpp
src/core/io/qdatastream.cpp
src/core/io/qdatastream.h
src/core/tools/qchar.cpp
src/core/tools/qstring.cpp
src/gui/image/qimage.cpp
src/gui/image/qpixmap_x11.cpp
src/gui/image/qpixmapfilter.cpp
src/gui/painting/qpaintengine_x11.cpp
src/tools/uic/cpp/cppwriteincludes.cpp
tests/auto/qdatastream/tst_qdatastream.cpp
tests/auto/qlocale/tst_qlocale.cpp

index b60ee20..63f7197 100644 (file)
@@ -911,7 +911,6 @@ katie_generate_obsolete(QStyleOptionViewItemV2 QtGui qstyleoption.h)
 katie_generate_obsolete(QStyleOptionViewItemV3 QtGui qstyleoption.h)
 katie_generate_obsolete(QStyleOptionViewItemV4 QtGui qstyleoption.h)
 katie_generate_obsolete(QSwipeGesture QtGui qgesture.h)
-katie_generate_obsolete(QSysInfo QtCore qglobal.h)
 katie_generate_obsolete(QTableWidgetItem QtGui qtablewidget.h)
 katie_generate_obsolete(QTableWidgetSelectionRange QtGui qtablewidget.h)
 katie_generate_obsolete(QtAlgorithms QtCore qalgorithms.h)
index 3079c18..1f98ebe 100644 (file)
@@ -163,7 +163,6 @@ include/katie/QtCore/QStringList
 include/katie/QtCore/QStringListIterator
 include/katie/QtCore/QStringMatcher
 include/katie/QtCore/QStringRef
-include/katie/QtCore/QSysInfo
 include/katie/QtCore/QSystemSemaphore
 include/katie/QtCore/QTemporaryFile
 include/katie/QtCore/QTextBoundaryFinder
index 2edfc34..2760a46 100644 (file)
@@ -166,7 +166,6 @@ include/katie/QtCore/QStringList
 include/katie/QtCore/QStringListIterator
 include/katie/QtCore/QStringMatcher
 include/katie/QtCore/QStringRef
-include/katie/QtCore/QSysInfo
 include/katie/QtCore/QSystemSemaphore
 include/katie/QtCore/QTemporaryFile
 include/katie/QtCore/QTextBoundaryFinder
index 016cf22..a4214d5 100644 (file)
@@ -166,7 +166,6 @@ include/katie/QtCore/QStringList
 include/katie/QtCore/QStringListIterator
 include/katie/QtCore/QStringMatcher
 include/katie/QtCore/QStringRef
-include/katie/QtCore/QSysInfo
 include/katie/QtCore/QSystemSemaphore
 include/katie/QtCore/QTemporaryFile
 include/katie/QtCore/QTextBoundaryFinder
index ec27a10..e381795 100755 (executable)
@@ -85,7 +85,6 @@ incmap = {
         'QSizeF': 'qsize.h',
         'QStringListIterator': 'qstringlist.h',
         'QStringRef': 'qstring.h',
-        'QSysInfo': 'qglobal.h',
         'QTextDecoder': 'qtextcodec.h',
         'QTextEncoder': 'qtextcodec.h',
         'QTextStreamFunction': 'qtextstream.h',
index cddfbfb..e8652b2 100755 (executable)
@@ -661,7 +661,6 @@ classlist = [
     "QSvgWidget",
     "QSwipeGesture",
     "QSyntaxHighlighter",
-    "QSysInfo",
     "QSystemSemaphore",
     "QSystemTrayIcon",
     "Qt",
index a86a80c..01d077c 100644 (file)
@@ -474,7 +474,7 @@ QT_BEGIN_NAMESPACE
     Qt's version number, i.e the version the application is compiled
     against.
 
-    \sa <QtAlgorithms>, QSysInfo
+    \sa <QtAlgorithms>
 */
 
 /*!
@@ -807,27 +807,6 @@ const char *qVersion()
  *****************************************************************************/
 
 /*!
-    \class QSysInfo
-    \brief The QSysInfo class provides information about the system.
-
-    \list
-    \o \l ByteOrder specifies whether the platform is big-endian or
-       little-endian.
-    \endlist
-
-    \sa QLibraryInfo
-*/
-
-/*!
-    \enum QSysInfo::Endian
-
-    \value BigEndian  Big-endian byte order (also called Network byte order)
-    \value LittleEndian  Little-endian byte order
-    \value ByteOrder  Equals BigEndian or LittleEndian, depending on
-                      the platform's byte order.
-*/
-
-/*!
     \macro Q_WS_X11
     \relates <QtGlobal>
 
index 4ce4e94..f547054 100644 (file)
@@ -300,23 +300,6 @@ typedef double qreal;
 #  define QT_RETHROW throw
 #endif
 
-/*
-   System information
-*/
-class Q_CORE_EXPORT QSysInfo {
-public:
-    enum Endian {
-        BigEndian,
-        LittleEndian,
-
-#if Q_BYTE_ORDER == Q_BIG_ENDIAN
-        ByteOrder = BigEndian
-#elif Q_BYTE_ORDER == Q_LITTLE_ENDIAN
-        ByteOrder = LittleEndian
-#endif
-    };
-};
-
 Q_CORE_EXPORT const char *qVersion();
 
 /*
index af56098..0399d9d 100644 (file)
@@ -38,7 +38,7 @@ QT_BEGIN_NAMESPACE
     that are compiled into the Katie library. For more information, see
     the \l {Using Katie.conf} documentation.
 
-    \sa QSysInfo, {Using Katie.conf}
+    \sa {Using Katie.conf}
 */
 
 /*!
index 4730175..bd4aba5 100644 (file)
@@ -179,6 +179,7 @@ QT_BEGIN_NAMESPACE
 
     \value BigEndian Most significant byte first (the default)
     \value LittleEndian Least significant byte first
+    \value HostEndian Either BigEndian or LittleEndian, depends on the host endian
 */
 
 /*!
@@ -242,7 +243,7 @@ QT_BEGIN_NAMESPACE
 QDataStream::QDataStream()
     : dev(nullptr),
     owndev(false),
-    noswap(QSysInfo::ByteOrder == QSysInfo::BigEndian),
+    noswap(QDataStream::HostEndian == QDataStream::BigEndian),
     byteorder(QDataStream::BigEndian),
     ver(QDataStream::Qt_Default),
     q_status(QDataStream::Ok),
@@ -265,7 +266,7 @@ QDataStream::QDataStream()
 QDataStream::QDataStream(QIODevice *device)
     : dev(device),
     owndev(false),
-    noswap(QSysInfo::ByteOrder == QSysInfo::BigEndian),
+    noswap(QDataStream::HostEndian == QDataStream::BigEndian),
     byteorder(QDataStream::BigEndian),
     ver(QDataStream::Qt_Default),
     q_status(QDataStream::Ok),
@@ -290,7 +291,7 @@ QDataStream::QDataStream(QIODevice *device)
 QDataStream::QDataStream(QByteArray *a, QIODevice::OpenMode flags)
     : dev(nullptr),
     owndev(true),
-    noswap(QSysInfo::ByteOrder == QSysInfo::BigEndian),
+    noswap(QDataStream::HostEndian == QDataStream::BigEndian),
     byteorder(QDataStream::BigEndian),
     ver(QDataStream::Qt_Default),
     q_status(QDataStream::Ok),
@@ -315,7 +316,7 @@ QDataStream::QDataStream(QByteArray *a, QIODevice::OpenMode flags)
 QDataStream::QDataStream(const QByteArray &a)
     : dev(nullptr),
     owndev(true),
-    noswap(QSysInfo::ByteOrder == QSysInfo::BigEndian),
+    noswap(QDataStream::HostEndian == QDataStream::BigEndian),
     byteorder(QDataStream::BigEndian),
     ver(QDataStream::Qt_Default),
     q_status(QDataStream::Ok),
@@ -486,11 +487,7 @@ void QDataStream::setStatus(DataStatus status)
 void QDataStream::setByteOrder(ByteOrder bo)
 {
     byteorder = bo;
-#if Q_BYTE_ORDER == Q_BIG_ENDIAN
-    noswap = (byteorder == BigEndian);
-#else
-    noswap = (byteorder == LittleEndian);
-#endif
+    noswap = (byteorder == QDataStream::HostEndian);
 }
 
 /*!
index c0afdd3..57434c6 100644 (file)
@@ -55,8 +55,9 @@ public:
     };
 
     enum ByteOrder {
-        BigEndian = QSysInfo::BigEndian,
-        LittleEndian = QSysInfo::LittleEndian
+        BigEndian = Q_BIG_ENDIAN,
+        LittleEndian = Q_LITTLE_ENDIAN,
+        HostEndian = Q_BYTE_ORDER
     };
 
     enum DataStatus {
index 9585a09..006a77d 100644 (file)
@@ -1644,10 +1644,4 @@ QDataStream &operator>>(QDataStream &in, QChar &chr)
     Use toUpper() instead.
 */
 
-/*!
-    \fn bool QChar::networkOrdered()
-
-    See if QSysInfo::ByteOrder == QSysInfo::BigEndian instead.
-*/
-
 QT_END_NAMESPACE
index 2bef356..d7aab2d 100644 (file)
@@ -6666,7 +6666,7 @@ QString &QString::setRawData(const QChar *unicode, int size)
 QDataStream &operator<<(QDataStream &out, const QString &str)
 {
     if (!str.isEmpty()) {
-        if ((out.byteOrder() == QDataStream::BigEndian) == (QSysInfo::ByteOrder == QSysInfo::BigEndian)) {
+        if (out.byteOrder() == QDataStream::HostEndian) {
             out.writeBytes(reinterpret_cast<const char *>(str.unicode()), sizeof(QChar) * str.length());
         } else {
             QSTACKARRAY(ushort, buffer, str.length());
@@ -6722,8 +6722,7 @@ QDataStream &operator>>(QDataStream &in, QString &str)
             allocated += blockSize;
         }
 
-        if ((in.byteOrder() == QDataStream::BigEndian)
-                != (QSysInfo::ByteOrder == QSysInfo::BigEndian)) {
+        if (in.byteOrder() != QDataStream::HostEndian) {
             ushort *data = reinterpret_cast<ushort *>(str.data());
             while (len--) {
                 *data = qbswap(*data);
index aaf144a..28e0376 100644 (file)
@@ -1598,15 +1598,6 @@ void QImage::invertPixels(InvertMode mode)
     parameter instead.
 */
 
-/*! \fn QImage::Endian QImage::systemByteOrder()
-
-    Determines the host computer byte order. Returns
-    QImage::LittleEndian (LSB first) or QImage::BigEndian (MSB first).
-
-    This function is no longer relevant for QImage. Use QSysInfo
-    instead.
-*/
-
 /*!
     \since 4.6
     Resizes the color table to contain \a colorCount entries.
@@ -3951,16 +3942,6 @@ void QImage::setDotsPerMeterY(int y)
     Makes a call to QPixmap::convertToImage().
 */
 
-/*! \fn QImage::Endian QImage::systemBitOrder()
-
-    Determines the bit order of the display hardware. Returns
-    QImage::LittleEndian (LSB first) or QImage::BigEndian (MSB first).
-
-    This function is no longer relevant for QImage. Use QSysInfo
-    instead.
-*/
-
-
 /*!
     \internal
 
index b25b270..1595dea 100644 (file)
@@ -449,7 +449,7 @@ void QX11PixmapData::fromImage(const QImage &img,
             Q_ASSERT(false);
         }
 
-        if ((xi->byte_order == MSBFirst) != (QSysInfo::ByteOrder == QSysInfo::BigEndian)) {
+        if ((xi->byte_order == MSBFirst) != (Q_BYTE_ORDER == Q_BIG_ENDIAN)) {
             uint *xidata = (uint *)xi->data;
             uint *xiend = xidata + w*h;
             while (xidata < xiend) {
@@ -568,7 +568,7 @@ void QX11PixmapData::fromImage(const QImage &img,
                BPP32_MSB, BPP32_LSB
         } mode = BPP8;
 
-        bool same_msb_lsb = (xi->byte_order == MSBFirst) == (QSysInfo::ByteOrder == QSysInfo::BigEndian);
+        bool same_msb_lsb = (xi->byte_order == MSBFirst) == (Q_BYTE_ORDER == Q_BIG_ENDIAN);
 
         if(bppc == 8) // 8 bit
             mode = BPP8;
@@ -1366,8 +1366,8 @@ QImage QX11PixmapData::takeQImageFromXImage(XImage *xi) const
     xi->data = 0;
 
     // we may have to swap the byte order
-    if ((QSysInfo::ByteOrder == QSysInfo::LittleEndian && xi->byte_order == MSBFirst)
-        || (QSysInfo::ByteOrder == QSysInfo::BigEndian && xi->byte_order == LSBFirst))
+    if ((Q_BYTE_ORDER == Q_LITTLE_ENDIAN && xi->byte_order == MSBFirst)
+        || (Q_BYTE_ORDER == Q_BIG_ENDIAN && xi->byte_order == LSBFirst))
     {
         const int bpl = image.bytesPerLine();
         uchar* dest = image.bits();
index 78168d2..6c02373 100644 (file)
@@ -315,16 +315,16 @@ static inline void qt_blurinner_alphaOnly(uchar *bptr, int &z, int alpha)
     *(bptr) = z >> (zprec + aprec);
 }
 
-static const int alphaIndex = (QSysInfo::ByteOrder == QSysInfo::BigEndian ? 0 : 3);
-
 static inline void qt_blurrow(QImage & im, int line, int alpha, bool alphaOnly)
 {
     uchar *bptr = im.scanLine(line);
 
     int zR = 0, zG = 0, zB = 0, zA = 0;
 
+#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
     if (alphaOnly && im.format() != QImage::Format_Indexed8)
-        bptr += alphaIndex;
+        bptr += 3;
+#endif
 
     const int stride = im.depth() >> 3;
     const int im_width = im.width();
index 62d3de2..95b75df 100644 (file)
@@ -1768,8 +1768,8 @@ Q_GUI_EXPORT void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const Q
     const int h = rect.height();
 
     int image_byte_order = ImageByteOrder(qt_x11Data->display);
-    if ((QSysInfo::ByteOrder == QSysInfo::BigEndian && ((image_byte_order == LSBFirst) || bgr_layout))
-        || (image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)
+    if ((Q_BYTE_ORDER == Q_BIG_ENDIAN && ((image_byte_order == LSBFirst) || bgr_layout))
+        || (image_byte_order == MSBFirst && Q_BYTE_ORDER == Q_LITTLE_ENDIAN)
         || (image_byte_order == LSBFirst && bgr_layout))
     {
         QImage im = image->copy(rect);
@@ -1778,19 +1778,19 @@ Q_GUI_EXPORT void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const Q
         for (int i=0; i < h; i++) {
             uint *p = data;
             uint *end = p + w;
-            if (bgr_layout && image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
+            if (bgr_layout && image_byte_order == MSBFirst && Q_BYTE_ORDER == Q_LITTLE_ENDIAN) {
                 while (p < end) {
                     *p = ((*p << 8) & 0xffffff00) | ((*p >> 24) & 0x000000ff);
                     p++;
                 }
-            } else if ((image_byte_order == LSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian)
-                    || (image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::LittleEndian)) {
+            } else if ((image_byte_order == LSBFirst && Q_BYTE_ORDER == Q_BIG_ENDIAN)
+                    || (image_byte_order == MSBFirst && Q_BYTE_ORDER == Q_LITTLE_ENDIAN)) {
                 while (p < end) {
                     *p = ((*p << 24) & 0xff000000) | ((*p << 8) & 0x00ff0000)
                         | ((*p >> 8) & 0x0000ff00) | ((*p >> 24) & 0x000000ff);
                     p++;
                 }
-            } else if ((image_byte_order == MSBFirst && QSysInfo::ByteOrder == QSysInfo::BigEndian)
+            } else if ((image_byte_order == MSBFirst && Q_BYTE_ORDER == Q_BIG_ENDIAN)
                        || (image_byte_order == LSBFirst && bgr_layout))
             {
                 while (p < end) {
index 952d9e3..4cd1ea1 100644 (file)
@@ -607,7 +607,6 @@ static const struct ClassTblData {
     { QLatin1String("QSvgWidget"), QLatin1String("QtSvg/qsvgwidget.h") },
     { QLatin1String("QSwipeGesture"), QLatin1String("QtGui/qgesture.h") },
     { QLatin1String("QSyntaxHighlighter"), QLatin1String("QtGui/qsyntaxhighlighter.h") },
-    { QLatin1String("QSysInfo"), QLatin1String("QtCore/qglobal.h") },
     { QLatin1String("QSystemSemaphore"), QLatin1String("QtCore/qsystemsemaphore.h") },
     { QLatin1String("QSystemTrayIcon"), QLatin1String("QtGui/qsystemtrayicon.h") },
     { QLatin1String("QTabBar"), QLatin1String("QtGui/qtabbar.h") },
index 7219807..1a14b12 100644 (file)
@@ -3003,9 +3003,11 @@ void tst_QDataStream::streamRealDataTypes()
 
 void tst_QDataStream::floatingPointNaN()
 {
-    QDataStream::ByteOrder bo = QSysInfo::ByteOrder == QSysInfo::BigEndian
-                                ? QDataStream::LittleEndian
-                                : QDataStream::BigEndian;
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+    QDataStream::ByteOrder bo = QDataStream::LittleEndian;
+#else
+    QDataStream::ByteOrder bo = QDataStream::BigEndian;
+#endif
 
     // Test and verify that values that become (s)nan's after swapping endianness
     // don't change in the process.
index bcb5e4a..03145a1 100644 (file)
@@ -770,7 +770,11 @@ void tst_QLocale::negativeZero()
 {
     double negativeZero( 0.0 ); // Initialise to zero.
     uchar *ptr = (uchar *)&negativeZero;
-    ptr[QSysInfo::ByteOrder == QSysInfo::BigEndian ? 0 : 7] = 0x80;
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+    ptr[0] = 0x80;
+#else
+    ptr[7] = 0x80;
+#endif
     QString s = QString::number(negativeZero);
     QCOMPARE(s, QString("0"));
 }