From b0c0d79ee42879586525349ead5ada574e6e0a65 Mon Sep 17 00:00:00 2001
From: Kai Koehne <kai.koehne@qt.io>
Date: Wed, 15 Aug 2018 09:58:36 +0200
Subject: [PATCH] Remove compatibility with older qtbase

Amends 4bbc782fc70f30e8b15.

Task-number: QTBUG-69911
Change-Id: I821739583e347f95a0aa114008e01db1e42eef92
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/activeqt/container/qaxbase.cpp | 11 +++++------
 tools/dumpcpp/main.cpp             |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index bfa09a9a..25af9831 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -3023,7 +3023,7 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
     int_data_size += classinfo_list.count() * 2;
     int_data_size += (signal_list.count() + slot_list.count()) * 5 + paramsDataSize;
     int_data_size += property_list.count() * 3;
-    int_data_size += enum_list.count() * ((QMetaObjectPrivate::OutputRevision == 8) ? 5 : 4);
+    int_data_size += enum_list.count() * 5;
     const EnumListMapConstIterator ecend = enum_list.end();
     for (EnumListMapConstIterator it = enum_list.begin(); it != ecend; ++it)
         int_data_size += it.value().count() * 2;
@@ -3031,7 +3031,7 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
 
     uint *int_data = new uint[int_data_size];
     QMetaObjectPrivate *header = reinterpret_cast<QMetaObjectPrivate *>(int_data);
-    Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 7 || QMetaObjectPrivate::OutputRevision == 8, "QtDBus meta-object generator should generate the same version as moc");
+    Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 8, "QtDBus meta-object generator should generate the same version as moc");
     header->revision = QMetaObjectPrivate::OutputRevision;
     header->className = 0;
     header->classInfoCount = classinfo_list.count();
@@ -3118,7 +3118,7 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
     }
     Q_ASSERT(offset == header->enumeratorData);
 
-    int value_offset = offset + enum_list.count() * ((QMetaObjectPrivate::OutputRevision == 8) ? 5 : 4);
+    int value_offset = offset + enum_list.count() * 5;
     // each enum in form name\0
     for (EnumListMapConstIterator it = enum_list.begin(); it != ecend; ++it) {
         QByteArray name(it.key());
@@ -3126,14 +3126,13 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
 
         uint nameId = uint(strings.enter(name));
         int_data[offset++] = nameId;
-        if (QMetaObjectPrivate::OutputRevision == 8)
-            int_data[offset++] = nameId;
+        int_data[offset++] = nameId;
         int_data[offset++] = 0x0; // 0x1 for flag?
         int_data[offset++] = uint(count);
         int_data[offset++] = uint(value_offset);
         value_offset += count * 2;
     }
-    Q_ASSERT(offset == header->enumeratorData + enum_list.count() * ((QMetaObjectPrivate::OutputRevision == 8) ? 5 : 4));
+    Q_ASSERT(offset == header->enumeratorData + enum_list.count() * 5);
 
     // each enum value in form key\0
     for (EnumListMapConstIterator it = enum_list.begin(); it != ecend; ++it) {
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp
index caf40090..4601aef4 100644
--- a/tools/dumpcpp/main.cpp
+++ b/tools/dumpcpp/main.cpp
@@ -692,7 +692,7 @@ void generateMethodParameters(QTextStream &out, const QMetaObject *mo, const QMe
 void generateClassImpl(QTextStream &out, const QMetaObject *mo, const QByteArray &className,
                        const QByteArray &nameSpace, ObjectCategories category)
 {
-    Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 7 || QMetaObjectPrivate::OutputRevision == 8, "dumpcpp should generate the same version as moc");
+    Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 8, "dumpcpp should generate the same version as moc");
 
     QByteArray qualifiedClassName;
     if (!nameSpace.isEmpty())
-- 
GitLab