From b9519412ae83fba27d00d0548e7727f226dba22a Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Sat, 20 Jan 2024 12:44:39 +0100 Subject: [PATCH] Move all registration functionality to a separate unit Move functionality related to the registration of the protobuf messages to a separate header/source files. Task-number: QTBUG-120931 Change-Id: I6076b41139d43982148e46f5f315808509c4db65 Reviewed-by: Tatiana Borisova --- .../grpc/chat/client/simplechatengine.cpp | 2 + src/protobuf/CMakeLists.txt | 1 + src/protobuf/qprotobufbaseserializer.cpp | 29 -- src/protobuf/qprotobufbaseserializer.h | 271 ---------------- src/protobuf/qprotobufjsonserializer.cpp | 1 + src/protobuf/qprotobufmessage.cpp | 3 +- src/protobuf/qprotobufregistration.cpp | 193 +++++++++++ src/protobuf/qprotobufregistration.h | 306 ++++++++++++++++++ src/protobuf/qprotobufserializer.cpp | 46 +-- src/protobuf/qtprotobuftypes.cpp | 115 +------ src/protobuf/qtprotobuftypes.h | 13 - .../qtprotobufqttypescommon_p.h | 1 + .../qtprotobufgen/qprotobufgenerator.cpp | 4 +- src/wellknown/qprotobufanysupport.cpp | 1 + .../folder/qtgrpc/tests/testservice.qpb.cpp | 2 +- .../testservice_protobuftyperegistrations.cpp | 2 +- .../converters/tst_protobuf_converter.cpp | 1 + .../optional/tst_protobuf_optional.cpp | 1 + .../comments/annotation.qpb.cpp | 2 +- .../annotation_protobuftyperegistrations.cpp | 2 +- .../extra-namespace/extranamespace.qpb.cpp | 2 +- ...tranamespace_protobuftyperegistrations.cpp | 2 +- .../fieldenum/fieldindexrange.qpb.cpp | 2 +- ...ldindexrange_protobuftyperegistrations.cpp | 2 +- .../optional/tests/optional.qpb.cpp | 2 +- .../optional_protobuftyperegistrations.cpp | 2 +- .../tests/basicmessages.qpb.cpp | 2 +- ...asicmessages_protobuftyperegistrations.cpp | 2 +- .../tests/mapmessages.qpb.cpp | 2 +- .../mapmessages_protobuftyperegistrations.cpp | 2 +- .../tests/oneofmessages.qpb.cpp | 2 +- ...neofmessages_protobuftyperegistrations.cpp | 2 +- .../tests/repeatedmessages.qpb.cpp | 2 +- ...atedmessages_protobuftyperegistrations.cpp | 2 +- .../no-options/annotation.qpb.cpp | 2 +- .../annotation_protobuftyperegistrations.cpp | 2 +- .../no-options/anymessages.qpb.cpp | 2 +- .../anymessages_protobuftyperegistrations.cpp | 2 +- .../no-options/basicmessages.qpb.cpp | 2 +- ...asicmessages_protobuftyperegistrations.cpp | 2 +- .../no-options/extranamespace.qpb.cpp | 2 +- ...tranamespace_protobuftyperegistrations.cpp | 2 +- .../no-options/fieldindexrange.qpb.cpp | 2 +- ...ldindexrange_protobuftyperegistrations.cpp | 2 +- .../no-options/mapmessages.qpb.cpp | 2 +- .../mapmessages_protobuftyperegistrations.cpp | 2 +- .../no-options/oneofmessages.qpb.cpp | 2 +- ...neofmessages_protobuftyperegistrations.cpp | 2 +- .../no-options/optional.qpb.cpp | 2 +- .../optional_protobuftyperegistrations.cpp | 2 +- .../no-options/repeatedmessages.qpb.cpp | 2 +- ...atedmessages_protobuftyperegistrations.cpp | 2 +- .../repeatednonpackedmessages.qpb.cpp | 2 +- ...ckedmessages_protobuftyperegistrations.cpp | 2 +- .../packed/repeatednonpackedmessages.qpb.cpp | 2 +- ...ckedmessages_protobuftyperegistrations.cpp | 2 +- .../qml-no-package/nopackage.qpb.cpp | 2 +- .../nopackage_protobuftyperegistrations.cpp | 2 +- .../qml-no-package/nopackageexternal.qpb.cpp | 2 +- ...kageexternal_protobuftyperegistrations.cpp | 2 +- .../qmlgen/basicmessages.qpb.cpp | 2 +- ...asicmessages_protobuftyperegistrations.cpp | 2 +- .../qmlgen/enummessages.qpb.cpp | 2 +- ...enummessages_protobuftyperegistrations.cpp | 2 +- .../qmlgen/oneofmessages.qpb.cpp | 2 +- ...neofmessages_protobuftyperegistrations.cpp | 2 +- .../qmlgen/repeatedmessages.qpb.cpp | 2 +- ...atedmessages_protobuftyperegistrations.cpp | 2 +- 68 files changed, 568 insertions(+), 524 deletions(-) create mode 100644 src/protobuf/qprotobufregistration.cpp create mode 100644 src/protobuf/qprotobufregistration.h diff --git a/examples/grpc/chat/client/simplechatengine.cpp b/examples/grpc/chat/client/simplechatengine.cpp index c5f41650..c659f231 100644 --- a/examples/grpc/chat/client/simplechatengine.cpp +++ b/examples/grpc/chat/client/simplechatengine.cpp @@ -6,6 +6,8 @@ #include +#include + #include #include #include diff --git a/src/protobuf/CMakeLists.txt b/src/protobuf/CMakeLists.txt index d3efdc00..d1de1cbd 100644 --- a/src/protobuf/CMakeLists.txt +++ b/src/protobuf/CMakeLists.txt @@ -13,6 +13,7 @@ qt_internal_add_module(Protobuf qprotobufserializer.cpp qprotobufserializer.h qprotobufserializer_p.h qprotobufjsonserializer.cpp qprotobufjsonserializer.h qtprotobuflogging.cpp qtprotobuflogging_p.h + qprotobufregistration.cpp qprotobufregistration.h qtprotobuftypes.cpp qtprotobuftypes.h qprotobufoneof.cpp qprotobufoneof.h GENERATE_CPP_EXPORTS diff --git a/src/protobuf/qprotobufbaseserializer.cpp b/src/protobuf/qprotobufbaseserializer.cpp index 084495ab..ced8bc81 100644 --- a/src/protobuf/qprotobufbaseserializer.cpp +++ b/src/protobuf/qprotobufbaseserializer.cpp @@ -3,8 +3,6 @@ #include "qprotobufbaseserializer.h" -#include - QT_BEGIN_NAMESPACE /*! @@ -155,31 +153,4 @@ QT_BEGIN_NAMESPACE \sa QProtobufBaseSerializer::serializeEnumList() */ -/*! - \relates QProtobufBaseSerializer - \fn template inline void qRegisterProtobufType() - - Registers a Protobuf type \e T. - This function is normally called by generated code. -*/ - -/*! - \relates QProtobufBaseSerializer - \fn template inline void qRegisterProtobufMapType(); - - Registers a Protobuf map type \c K and \c V. - \c V must be a QProtobufMessage. - This function is normally called by generated code. -*/ - -/*! - \relates QProtobufBaseSerializer - \fn template inline void qRegisterProtobufEnumType(); - - Registers serializers for enumeration type \c T in QtProtobuf global - serializers registry. - - This function is normally called by generated code. -*/ - QT_END_NAMESPACE diff --git a/src/protobuf/qprotobufbaseserializer.h b/src/protobuf/qprotobufbaseserializer.h index deb1c12c..41051255 100644 --- a/src/protobuf/qprotobufbaseserializer.h +++ b/src/protobuf/qprotobufbaseserializer.h @@ -6,11 +6,8 @@ #include -#include #include #include -#include -#include #include QT_BEGIN_NAMESPACE @@ -51,273 +48,5 @@ public: const QMetaEnum &metaEnum) const = 0; }; -namespace QtProtobufPrivate { - -using Serializer = void (*)(const QProtobufBaseSerializer *, const QVariant &, - const QProtobufPropertyOrderingInfo &); -using Deserializer = void (*)(const QProtobufBaseSerializer *, QVariant &); - -/*! - \private - \brief SerializationHandlers contains set of objects that required for class - serialization/deserialization - */ -struct SerializationHandler -{ - Serializer serializer = nullptr; /*!< serializer assigned to class */ - Deserializer deserializer = nullptr; /*!< deserializer assigned to class */ -}; - -extern Q_PROTOBUF_EXPORT SerializationHandler findHandler(QMetaType type); -extern Q_PROTOBUF_EXPORT void registerHandler(QMetaType type, const SerializationHandler &handlers); - -/*! - \private - \brief default serializer template for type T that inherits from QProtobufMessage - */ -template ::value, int> = 0> -void serializeObject(const QProtobufBaseSerializer *serializer, const QVariant &value, - const QProtobufPropertyOrderingInfo &fieldInfo) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); - serializer->serializeObject(value.value(), T::staticPropertyOrdering, fieldInfo); -} - -/*! - \private - \brief default serializer template for list of type T objects that inherits from QProtobufMessage - */ -template ::value, int> = 0> -void serializeList(const QProtobufBaseSerializer *serializer, const QVariant &listValue, - const QProtobufPropertyOrderingInfo &fieldInfo) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufSerializer", "Serializer is null"); - for (const auto &value : listValue.value>()) { - serializer->serializeListObject(&value, V::staticPropertyOrdering, fieldInfo); - } -} - -/*! - \private - \brief default serializer template for map of key K, value V - */ -template ::value, int> = 0> -void serializeMap(const QProtobufBaseSerializer *serializer, const QVariant &value, - const QProtobufPropertyOrderingInfo &fieldInfo) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufSerializer", "Serializer is null"); - for (const auto &[k, v] : value.value>().asKeyValueRange()) { - serializer->serializeMapPair(QVariant::fromValue(k), QVariant::fromValue(v), - fieldInfo); - } -} - -/*! - \private - \brief default serializer template for map of type key K, value V. Specialization for V that - inherits from QProtobufMessage - */ -template ::value, int> = 0> -void serializeMap(const QProtobufBaseSerializer *serializer, const QVariant &value, - const QProtobufPropertyOrderingInfo &fieldInfo) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufSerializer", "Serializer is null"); - for (const auto &[k, v] : value.value>().asKeyValueRange()) { - serializer->serializeMapPair(QVariant::fromValue(k), QVariant::fromValue(&v), - fieldInfo); - } -} - -/*! - \private - \brief default serializer template for enum types - */ -template ::value, int> = 0> -void serializeEnum(const QProtobufBaseSerializer *serializer, const QVariant &value, - const QProtobufPropertyOrderingInfo &fieldInfo) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); - static const QMetaEnum metaEnum = QMetaEnum::fromType(); - serializer->serializeEnum(QtProtobuf::int64(value.value()), metaEnum, - fieldInfo); -} - -/*! - \private - \brief default serializer template for enum list types - */ -template ::value, int> = 0> -void serializeEnumList(const QProtobufBaseSerializer *serializer, const QVariant &value, - const QProtobufPropertyOrderingInfo &fieldInfo) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); - static const QMetaEnum metaEnum = QMetaEnum::fromType(); - QList intList; - for (auto enumValue : value.value>()) { - intList.append(QtProtobuf::int64(enumValue)); - } - serializer->serializeEnumList(intList, metaEnum, fieldInfo); -} - -/*! - \private - \brief default deserializer template for type T that inherits from QProtobufMessage - */ -template ::value, int> = 0> -void deserializeObject(const QProtobufBaseSerializer *serializer, QVariant &to) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); - Q_ASSERT_X(to.isNull() || to.metaType() == QMetaType::fromType(), - "QProtobufBaseSerializer", - "Property should be either uninitialized or contain a valid pointer"); - - T *value = to.value(); - if (value == nullptr) { - value = new T; - to = QVariant::fromValue(value); - } - serializer->deserializeObject(value, T::staticPropertyOrdering); -} - -/*! - \private - \brief default deserializer template for list of type T objects that inherits from QProtobufMessage - */ -template ::value, int> = 0> -void deserializeList(const QProtobufBaseSerializer *serializer, QVariant &previous) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); - - V newValue; - serializer->deserializeListObject(&newValue, V::staticPropertyOrdering); - QList list = previous.value>(); - list.append(newValue); - previous.setValue(list); -} - -/*! - \private - * - \brief default deserializer template for map of key K, value V - */ -template ::value, int> = 0> -void deserializeMap(const QProtobufBaseSerializer *serializer, QVariant &previous) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); - - QHash out = previous.value>(); - QVariant key = QVariant::fromValue(K()); - QVariant value = QVariant::fromValue(V()); - - if (serializer->deserializeMapPair(key, value)) { - out[key.value()] = value.value(); - previous = QVariant::fromValue>(out); - } -} - -/*! - \private - * - \brief default deserializer template for map of type key K, value V. Specialization for V - that inherits from QProtobufMessage - */ -template ::value, int> = 0> -void deserializeMap(const QProtobufBaseSerializer *serializer, QVariant &previous) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); - - auto out = previous.value>(); - QVariant key = QVariant::fromValue(K()); - QVariant value = QVariant::fromValue(nullptr); - - bool ok = serializer->deserializeMapPair(key, value); - V *valuePtr = value.value(); - if (ok) { - out[key.value()] = valuePtr ? *valuePtr : V(); - previous = QVariant::fromValue>(out); - } - delete valuePtr; -} - -/*! - \private - * - \brief default deserializer template for enum type T - */ -template ::value, int> = 0> -void deserializeEnum(const QProtobufBaseSerializer *serializer, QVariant &to) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); - static const QMetaEnum metaEnum = QMetaEnum::fromType(); - QtProtobuf::int64 intValue; - if (serializer->deserializeEnum(intValue, metaEnum)) - to = QVariant::fromValue(static_cast(intValue._t)); -} - -/*! - \private - * - \brief default deserializer template for enumList type T - */ -template ::value, int> = 0> -void deserializeEnumList(const QProtobufBaseSerializer *serializer, QVariant &previous) -{ - Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); - static const QMetaEnum metaEnum = QMetaEnum::fromType(); - QList intList; - if (!serializer->deserializeEnumList(intList, metaEnum)) - return; - QList enumList = previous.value>(); - for (auto intValue : intList) - enumList.append(static_cast(intValue._t)); - previous = QVariant::fromValue>(enumList); -} -} // namespace QtProtobufPrivate - -template -inline void qRegisterProtobufType() -{ - T::registerTypes(); - QtProtobufPrivate::registerOrdering(QMetaType::fromType(), T::staticPropertyOrdering); - QtProtobufPrivate::registerHandler( - QMetaType::fromType(), - { QtProtobufPrivate::serializeObject, QtProtobufPrivate::deserializeObject }); - QtProtobufPrivate::registerHandler( - QMetaType::fromType>(), - { QtProtobufPrivate::serializeList, QtProtobufPrivate::deserializeList }); -} - -template -inline void qRegisterProtobufMapType() -{ - QtProtobufPrivate::registerHandler( - QMetaType::fromType>(), - { QtProtobufPrivate::serializeMap, QtProtobufPrivate::deserializeMap }); -} - -#ifdef Q_QDOC -template -inline void qRegisterProtobufEnumType(); -#else // !Q_QDOC -template::value, int> = 0> -inline void qRegisterProtobufEnumType() -{ - QtProtobufPrivate::registerHandler( - QMetaType::fromType(), - { QtProtobufPrivate::serializeEnum, QtProtobufPrivate::deserializeEnum }); - QtProtobufPrivate::registerHandler( - QMetaType::fromType>(), - { QtProtobufPrivate::serializeEnumList, QtProtobufPrivate::deserializeEnumList }); -} -#endif // Q_QDOC - QT_END_NAMESPACE #endif // QPROTOBUFSBASEERIALIZER_H diff --git a/src/protobuf/qprotobufjsonserializer.cpp b/src/protobuf/qprotobufjsonserializer.cpp index 037a46c9..ee3b11f8 100644 --- a/src/protobuf/qprotobufjsonserializer.cpp +++ b/src/protobuf/qprotobufjsonserializer.cpp @@ -3,6 +3,7 @@ #include "qprotobufjsonserializer.h" #include "qprotobufserializer_p.h" +#include "qprotobufregistration.h" #include #include diff --git a/src/protobuf/qprotobufmessage.cpp b/src/protobuf/qprotobufmessage.cpp index f53bda91..c27afec7 100644 --- a/src/protobuf/qprotobufmessage.cpp +++ b/src/protobuf/qprotobufmessage.cpp @@ -4,8 +4,9 @@ #include "qprotobufmessage.h" #include "qprotobufmessage_p.h" #include "qabstractprotobufserializer.h" +#include "qprotobufregistration.h" +#include "qtprotobuftypes.h" -#include #include #include diff --git a/src/protobuf/qprotobufregistration.cpp b/src/protobuf/qprotobufregistration.cpp new file mode 100644 index 00000000..e1b70c16 --- /dev/null +++ b/src/protobuf/qprotobufregistration.cpp @@ -0,0 +1,193 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#include "qprotobufregistration.h" +#include "qtprotobuftypes.h" + +#include +#include +#include + +#include + +QT_BEGIN_NAMESPACE + +/*! + \relates QtProtobuf + \fn template inline void qRegisterProtobufType() + + Registers a Protobuf type \e T. + This function is normally called by generated code. +*/ + +/*! + \relates QtProtobuf + \fn template inline void qRegisterProtobufMapType(); + + Registers a Protobuf map type \c K and \c V. + \c V must be a QProtobufMessage. + This function is normally called by generated code. +*/ + +/*! + \relates QtProtobuf + \fn template inline void qRegisterProtobufEnumType(); + + Registers serializers for enumeration type \c T in QtProtobuf global + serializers registry. + + This function is normally called by generated code. +*/ + +namespace { +std::vector ®isterFunctions() +{ + // no need for implicit sharing etc, so stick with std::vector + static std::vector registrationList; + return registrationList; +} + +template +void registerBasicConverters() +{ + QMetaType::registerConverter(T::fromType); + QMetaType::registerConverter(T::toType); + QMetaType::registerConverter(T::fromType); + QMetaType::registerConverter(T::toType); + QMetaType::registerConverter(T::fromType); + QMetaType::registerConverter(T::toType); + QMetaType::registerConverter(T::fromType); + QMetaType::registerConverter(T::toType); + if constexpr (!std::is_same_v) { + QMetaType::registerConverter(T::fromType); + QMetaType::registerConverter(T::toType); + QMetaType::registerConverter(T::fromType); + QMetaType::registerConverter(T::toType); + } + QMetaType::registerConverter(T::fromType); + QMetaType::registerConverter(T::toType); + QMetaType::registerConverter(T::toString); +} + +static void qRegisterBaseTypes() +{ + [[maybe_unused]] // definitely unused + static bool registered = [] { + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + + registerBasicConverters(); + registerBasicConverters(); + registerBasicConverters(); + registerBasicConverters(); + registerBasicConverters(); + registerBasicConverters(); + return true; + }(); +} + +/* + \internal + \brief The HandlersRegistry is a container to store mapping between metatype + identifier and serialization handlers. +*/ +struct HandlersRegistry +{ + void registerHandler(QMetaType type, const QtProtobufPrivate::SerializationHandler &handlers) + { + QWriteLocker locker(&m_lock); + m_registry[type] = handlers; + } + + QtProtobufPrivate::SerializationHandler findHandler(QMetaType type) + { + QtProtobufPrivate::SerializationHandler handler; + QReadLocker locker(&m_lock); + auto it = m_registry.constFind(type); + if (it != m_registry.constEnd()) + handler = it.value(); + return handler; + } + +private: + QReadWriteLock m_lock; + QHash m_registry; +}; +Q_GLOBAL_STATIC(HandlersRegistry, handlersRegistry) + + +Q_CONSTINIT QBasicMutex registerMutex; +} + +void QtProtobufPrivate::registerHandler(QMetaType type, + const QtProtobufPrivate::SerializationHandler &handlers) +{ + handlersRegistry->registerHandler(type, handlers); +} + +QtProtobufPrivate::SerializationHandler QtProtobufPrivate::findHandler(QMetaType type) +{ + if (!handlersRegistry.exists()) + return {}; + return handlersRegistry->findHandler(type); +} + +namespace QtProtobuf { + +ProtoTypeRegistrar::ProtoTypeRegistrar(QtProtobuf::RegisterFunction initializer) +{ + std::scoped_lock lock(registerMutex); + registerFunctions().push_back(initializer); +} + +} + +/*! + \relates QtProtobuf + Calling this function registers all, currently known, protobuf types with + the serializer registry. + + \note You should not have to call this function manually, as it is called + automatically upon attempting serialization or deserialization of a protobuf + message. +*/ +void qRegisterProtobufTypes() +{ + qRegisterBaseTypes(); + + std::vector registrationList; + // Move the list to a local variable, emptying the global one. + { + std::scoped_lock lock(registerMutex); + registrationList.swap(registerFunctions()); + } + + for (QtProtobuf::RegisterFunction registerFunc : registrationList) + registerFunc(); +} + +QT_END_NAMESPACE diff --git a/src/protobuf/qprotobufregistration.h b/src/protobuf/qprotobufregistration.h new file mode 100644 index 00000000..f5e70f99 --- /dev/null +++ b/src/protobuf/qprotobufregistration.h @@ -0,0 +1,306 @@ +// Copyright (C) 2024 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef QPROTOBUFREGISTRATION_H +#define QPROTOBUFREGISTRATION_H + +#if 0 +# pragma qt_sync_skip_header_check +# pragma qt_sync_stop_processing +#endif + +#include +#include +#include + +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +namespace QtProtobuf { +using RegisterFunction = void (*)(); +// This struct is used for type registrations in generated code +struct ProtoTypeRegistrar +{ + Q_PROTOBUF_EXPORT explicit ProtoTypeRegistrar(QtProtobuf::RegisterFunction initializer); +}; +} + + +namespace QtProtobufPrivate { +extern Q_PROTOBUF_EXPORT void registerOrdering(QMetaType type, QProtobufPropertyOrdering ordering); + +using Serializer = void (*)(const QProtobufBaseSerializer *, const QVariant &, + const QProtobufPropertyOrderingInfo &); +using Deserializer = void (*)(const QProtobufBaseSerializer *, QVariant &); + +/*! + \private + \brief SerializationHandlers contains set of objects that required for class + serialization/deserialization + */ +struct SerializationHandler +{ + Serializer serializer = nullptr; /*!< serializer assigned to class */ + Deserializer deserializer = nullptr; /*!< deserializer assigned to class */ +}; + +extern Q_PROTOBUF_EXPORT SerializationHandler findHandler(QMetaType type); +extern Q_PROTOBUF_EXPORT void registerHandler(QMetaType type, const SerializationHandler &handlers); + +/*! + \private + \brief default serializer template for type T that inherits from QProtobufMessage + */ +template ::value, int> = 0> +void serializeObject(const QProtobufBaseSerializer *serializer, const QVariant &value, + const QProtobufPropertyOrderingInfo &fieldInfo) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); + serializer->serializeObject(value.value(), T::staticPropertyOrdering, fieldInfo); +} + +/*! + \private + \brief default serializer template for list of type T objects that inherits from QProtobufMessage + */ +template ::value, int> = 0> +void serializeList(const QProtobufBaseSerializer *serializer, const QVariant &listValue, + const QProtobufPropertyOrderingInfo &fieldInfo) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufSerializer", "Serializer is null"); + for (const auto &value : listValue.value>()) { + serializer->serializeListObject(&value, V::staticPropertyOrdering, fieldInfo); + } +} + +/*! + \private + \brief default serializer template for map of key K, value V + */ +template ::value, int> = 0> +void serializeMap(const QProtobufBaseSerializer *serializer, const QVariant &value, + const QProtobufPropertyOrderingInfo &fieldInfo) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufSerializer", "Serializer is null"); + for (const auto &[k, v] : value.value>().asKeyValueRange()) { + serializer->serializeMapPair(QVariant::fromValue(k), QVariant::fromValue(v), + fieldInfo); + } +} + +/*! + \private + \brief default serializer template for map of type key K, value V. Specialization for V that + inherits from QProtobufMessage + */ +template ::value, int> = 0> +void serializeMap(const QProtobufBaseSerializer *serializer, const QVariant &value, + const QProtobufPropertyOrderingInfo &fieldInfo) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufSerializer", "Serializer is null"); + for (const auto &[k, v] : value.value>().asKeyValueRange()) { + serializer->serializeMapPair(QVariant::fromValue(k), QVariant::fromValue(&v), + fieldInfo); + } +} + +/*! + \private + \brief default serializer template for enum types + */ +template ::value, int> = 0> +void serializeEnum(const QProtobufBaseSerializer *serializer, const QVariant &value, + const QProtobufPropertyOrderingInfo &fieldInfo) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); + static const QMetaEnum metaEnum = QMetaEnum::fromType(); + serializer->serializeEnum(QtProtobuf::int64(value.value()), metaEnum, + fieldInfo); +} + +/*! + \private + \brief default serializer template for enum list types + */ +template ::value, int> = 0> +void serializeEnumList(const QProtobufBaseSerializer *serializer, const QVariant &value, + const QProtobufPropertyOrderingInfo &fieldInfo) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); + static const QMetaEnum metaEnum = QMetaEnum::fromType(); + QList intList; + for (auto enumValue : value.value>()) { + intList.append(QtProtobuf::int64(enumValue)); + } + serializer->serializeEnumList(intList, metaEnum, fieldInfo); +} + +/*! + \private + \brief default deserializer template for type T that inherits from QProtobufMessage + */ +template ::value, int> = 0> +void deserializeObject(const QProtobufBaseSerializer *serializer, QVariant &to) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); + Q_ASSERT_X(to.isNull() || to.metaType() == QMetaType::fromType(), + "QProtobufBaseSerializer", + "Property should be either uninitialized or contain a valid pointer"); + + T *value = to.value(); + if (value == nullptr) { + value = new T; + to = QVariant::fromValue(value); + } + serializer->deserializeObject(value, T::staticPropertyOrdering); +} + +/*! + \private + \brief default deserializer template for list of type T objects that inherits from QProtobufMessage + */ +template ::value, int> = 0> +void deserializeList(const QProtobufBaseSerializer *serializer, QVariant &previous) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); + + V newValue; + serializer->deserializeListObject(&newValue, V::staticPropertyOrdering); + QList list = previous.value>(); + list.append(newValue); + previous.setValue(list); +} + +/*! + \private + * + \brief default deserializer template for map of key K, value V + */ +template ::value, int> = 0> +void deserializeMap(const QProtobufBaseSerializer *serializer, QVariant &previous) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); + + QHash out = previous.value>(); + QVariant key = QVariant::fromValue(K()); + QVariant value = QVariant::fromValue(V()); + + if (serializer->deserializeMapPair(key, value)) { + out[key.value()] = value.value(); + previous = QVariant::fromValue>(out); + } +} + +/*! + \private + * + \brief default deserializer template for map of type key K, value V. Specialization for V + that inherits from QProtobufMessage + */ +template ::value, int> = 0> +void deserializeMap(const QProtobufBaseSerializer *serializer, QVariant &previous) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); + + auto out = previous.value>(); + QVariant key = QVariant::fromValue(K()); + QVariant value = QVariant::fromValue(nullptr); + + bool ok = serializer->deserializeMapPair(key, value); + V *valuePtr = value.value(); + if (ok) { + out[key.value()] = valuePtr ? *valuePtr : V(); + previous = QVariant::fromValue>(out); + } + delete valuePtr; +} + +/*! + \private + * + \brief default deserializer template for enum type T + */ +template ::value, int> = 0> +void deserializeEnum(const QProtobufBaseSerializer *serializer, QVariant &to) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); + static const QMetaEnum metaEnum = QMetaEnum::fromType(); + QtProtobuf::int64 intValue; + if (serializer->deserializeEnum(intValue, metaEnum)) + to = QVariant::fromValue(static_cast(intValue._t)); +} + +/*! + \private + * + \brief default deserializer template for enumList type T + */ +template ::value, int> = 0> +void deserializeEnumList(const QProtobufBaseSerializer *serializer, QVariant &previous) +{ + Q_ASSERT_X(serializer != nullptr, "QProtobufBaseSerializer", "Serializer is null"); + static const QMetaEnum metaEnum = QMetaEnum::fromType(); + QList intList; + if (!serializer->deserializeEnumList(intList, metaEnum)) + return; + QList enumList = previous.value>(); + for (auto intValue : intList) + enumList.append(static_cast(intValue._t)); + previous = QVariant::fromValue>(enumList); +} +} // namespace QtProtobufPrivate + +Q_PROTOBUF_EXPORT void qRegisterProtobufTypes(); + +template +inline void qRegisterProtobufType() +{ + T::registerTypes(); + QtProtobufPrivate::registerOrdering(QMetaType::fromType(), T::staticPropertyOrdering); + QtProtobufPrivate::registerHandler( + QMetaType::fromType(), + { QtProtobufPrivate::serializeObject, QtProtobufPrivate::deserializeObject }); + QtProtobufPrivate::registerHandler( + QMetaType::fromType>(), + { QtProtobufPrivate::serializeList, QtProtobufPrivate::deserializeList }); +} + +template +inline void qRegisterProtobufMapType() +{ + QtProtobufPrivate::registerHandler( + QMetaType::fromType>(), + { QtProtobufPrivate::serializeMap, QtProtobufPrivate::deserializeMap }); +} + +#ifdef Q_QDOC +template +inline void qRegisterProtobufEnumType(); +#else // !Q_QDOC +template::value, int> = 0> +inline void qRegisterProtobufEnumType() +{ + QtProtobufPrivate::registerHandler( + QMetaType::fromType(), + { QtProtobufPrivate::serializeEnum, QtProtobufPrivate::deserializeEnum }); + QtProtobufPrivate::registerHandler( + QMetaType::fromType>(), + { QtProtobufPrivate::serializeEnumList, QtProtobufPrivate::deserializeEnumList }); +} +#endif // Q_QDOC + +QT_END_NAMESPACE + +#endif // QPROTOBUFREGISTRATION_H diff --git a/src/protobuf/qprotobufserializer.cpp b/src/protobuf/qprotobufserializer.cpp index 854b970a..7ff23d1a 100644 --- a/src/protobuf/qprotobufserializer.cpp +++ b/src/protobuf/qprotobufserializer.cpp @@ -4,7 +4,7 @@ #include "qprotobufserializer.h" #include "qprotobufserializer_p.h" - +#include "qprotobufregistration.h" #include "qtprotobuftypes.h" #include @@ -22,57 +22,15 @@ QT_BEGIN_NAMESPACE namespace { -/* - \internal - \brief The HandlersRegistry is a container to store mapping between metatype - identifier and serialization handlers. -*/ -struct HandlersRegistry -{ - void registerHandler(QMetaType type, const QtProtobufPrivate::SerializationHandler &handlers) - { - QWriteLocker locker(&m_lock); - m_registry[type] = handlers; - } - - QtProtobufPrivate::SerializationHandler findHandler(QMetaType type) - { - QtProtobufPrivate::SerializationHandler handler; - QReadLocker locker(&m_lock); - auto it = m_registry.constFind(type); - if (it != m_registry.constEnd()) - handler = it.value(); - return handler; - } - -private: - QReadWriteLock m_lock; - QHash m_registry; -}; -Q_GLOBAL_STATIC(HandlersRegistry, handlersRegistry) - inline bool isOneofOrOptionalField(const QtProtobufPrivate::QProtobufPropertyOrderingInfo &fieldInfo) { return fieldInfo.getFieldFlags() & QtProtobufPrivate::Oneof - || fieldInfo.getFieldFlags() & QtProtobufPrivate::Optional; + || fieldInfo.getFieldFlags() & QtProtobufPrivate::Optional; } } // namespace -void QtProtobufPrivate::registerHandler(QMetaType type, - const QtProtobufPrivate::SerializationHandler &handlers) -{ - handlersRegistry->registerHandler(type, handlers); -} - -QtProtobufPrivate::SerializationHandler QtProtobufPrivate::findHandler(QMetaType type) -{ - if (!handlersRegistry.exists()) - return {}; - return handlersRegistry->findHandler(type); -} - /*! \class QProtobufSerializer \inmodule QtProtobuf diff --git a/src/protobuf/qtprotobuftypes.cpp b/src/protobuf/qtprotobuftypes.cpp index 6cf69a20..19e352b1 100644 --- a/src/protobuf/qtprotobuftypes.cpp +++ b/src/protobuf/qtprotobuftypes.cpp @@ -2,18 +2,14 @@ // Copyright (C) 2019 Alexey Edelev // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#include +#include "qtprotobuflogging_p.h" +#include "qtprotobuftypes.h" +#include "qprotobufregistration.h" #include -#include #include -#include - -#include "qtprotobuftypes.h" - #include -#include QT_BEGIN_NAMESPACE @@ -194,111 +190,6 @@ namespace QtProtobufPrivate { } } -namespace QtProtobuf { - -template -void registerBasicConverters() -{ - QMetaType::registerConverter(T::fromType); - QMetaType::registerConverter(T::toType); - QMetaType::registerConverter(T::fromType); - QMetaType::registerConverter(T::toType); - QMetaType::registerConverter(T::fromType); - QMetaType::registerConverter(T::toType); - QMetaType::registerConverter(T::fromType); - QMetaType::registerConverter(T::toType); - if constexpr (!std::is_same_v) { - QMetaType::registerConverter(T::fromType); - QMetaType::registerConverter(T::toType); - QMetaType::registerConverter(T::fromType); - QMetaType::registerConverter(T::toType); - } - QMetaType::registerConverter(T::fromType); - QMetaType::registerConverter(T::toType); - QMetaType::registerConverter(T::toString); -} - -Q_CONSTINIT QBasicMutex registerMutex; -std::vector ®isterFunctions() -{ - // no need for implicit sharing etc, so stick with std::vector - static std::vector registrationList; - return registrationList; -} - -ProtoTypeRegistrar::ProtoTypeRegistrar(QtProtobuf::RegisterFunction initializer) -{ - std::scoped_lock lock(registerMutex); - QtProtobuf::registerFunctions().push_back(initializer); -} - -} // namespace QtProtobuf - -static void qRegisterBaseTypes() -{ - [[maybe_unused]] // definitely unused - static bool registered = [] { - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - - qRegisterMetaType(); - qRegisterMetaType(); - qRegisterMetaType(); - - QtProtobuf::registerBasicConverters(); - QtProtobuf::registerBasicConverters(); - QtProtobuf::registerBasicConverters(); - QtProtobuf::registerBasicConverters(); - QtProtobuf::registerBasicConverters(); - QtProtobuf::registerBasicConverters(); - return true; - }(); -} - -/*! - \relates QtProtobuf - Calling this function registers all, currently known, protobuf types with - the serializer registry. - - \note You should not have to call this function manually, as it is called - automatically upon attempting serialization or deserialization of a protobuf - message. -*/ -void qRegisterProtobufTypes() -{ - qRegisterBaseTypes(); - - std::vector registrationList; - // Move the list to a local variable, emptying the global one. - { - std::scoped_lock lock(QtProtobuf::registerMutex); - registrationList.swap(QtProtobuf::registerFunctions()); - } - - for (QtProtobuf::RegisterFunction registerFunc : registrationList) - registerFunc(); -} - QT_IMPL_METATYPE_EXTERN_TAGGED(QtProtobuf::int32, QtProtobuf_int32) QT_IMPL_METATYPE_EXTERN_TAGGED(QtProtobuf::int64, QtProtobuf_int64) QT_IMPL_METATYPE_EXTERN_TAGGED(QtProtobuf::fixed32, QtProtobuf_fixed32) diff --git a/src/protobuf/qtprotobuftypes.h b/src/protobuf/qtprotobuftypes.h index 64e848a0..b20f0b43 100644 --- a/src/protobuf/qtprotobuftypes.h +++ b/src/protobuf/qtprotobuftypes.h @@ -12,9 +12,7 @@ #include #include -#include #include -#include QT_BEGIN_NAMESPACE @@ -49,8 +47,6 @@ private: }; static_assert(std::is_trivially_destructible_v); -extern Q_PROTOBUF_EXPORT void registerOrdering(QMetaType type, QProtobufPropertyOrdering ordering); - // Convenience structure to hold a reference to a single entry struct QProtobufPropertyOrderingInfo { @@ -155,13 +151,6 @@ using floatList = QList; using doubleList = QList; using boolList = QList; -using RegisterFunction = void (*)(); -// This struct is used for type registrations in generated code -struct ProtoTypeRegistrar -{ - Q_PROTOBUF_EXPORT explicit ProtoTypeRegistrar(QtProtobuf::RegisterFunction initializer); -}; - template bool repeatedValueCompare(const QList &a, const QList &b) { @@ -199,8 +188,6 @@ using qMakeUnsigned = typename qMakeUnsignedImpl::type; } // namespace QtProtobuf -Q_PROTOBUF_EXPORT void qRegisterProtobufTypes(); - QT_END_NAMESPACE QT_DECL_METATYPE_EXTERN_TAGGED(QtProtobuf::int32, QtProtobuf_int32, Q_PROTOBUF_EXPORT) diff --git a/src/protobufqttypes/protobufqtcoretypes/qtprotobufqttypescommon_p.h b/src/protobufqttypes/protobufqtcoretypes/qtprotobufqttypescommon_p.h index 33c9d506..41ef864e 100644 --- a/src/protobufqttypes/protobufqtcoretypes/qtprotobufqttypescommon_p.h +++ b/src/protobufqttypes/protobufqtcoretypes/qtprotobufqttypescommon_p.h @@ -18,6 +18,7 @@ #include #include +#include #include #include diff --git a/src/tools/qtprotobufgen/qprotobufgenerator.cpp b/src/tools/qtprotobufgen/qprotobufgenerator.cpp index 4a72e5cc..e8395968 100644 --- a/src/tools/qtprotobufgen/qprotobufgenerator.cpp +++ b/src/tools/qtprotobufgen/qprotobufgenerator.cpp @@ -67,7 +67,7 @@ void QProtobufGenerator::GenerateSources(const FileDescriptor *file, sourcePrinter->Print({{"include", basename + CommonTemplates::ProtoFileSuffix()}}, CommonTemplates::InternalIncludeTemplate()); - registrationPrinter->Print({{"include", "QtProtobuf/qprotobufserializer.h"}}, + registrationPrinter->Print({{"include", "QtProtobuf/qprotobufregistration.h"}}, CommonTemplates::ExternalIncludeTemplate()); registrationPrinter->Print({{"include", basename + CommonTemplates::ProtoFileSuffix()}}, @@ -85,7 +85,7 @@ void QProtobufGenerator::GenerateSources(const FileDescriptor *file, CommonTemplates::ExternalIncludeTemplate()); } - sourcePrinter->Print({{"include", "QtProtobuf/qprotobufserializer.h"}}, + sourcePrinter->Print({{"include", "QtProtobuf/qprotobufregistration.h"}}, CommonTemplates::ExternalIncludeTemplate()); sourcePrinter->Print({{"include", "cmath"}}, diff --git a/src/wellknown/qprotobufanysupport.cpp b/src/wellknown/qprotobufanysupport.cpp index 691be1b3..dfa5fbff 100644 --- a/src/wellknown/qprotobufanysupport.cpp +++ b/src/wellknown/qprotobufanysupport.cpp @@ -7,6 +7,7 @@ #include #include "qprotobufanysupport.h" +#include "qprotobufregistration.h" #include diff --git a/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice.qpb.cpp b/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice.qpb.cpp index e03d7496..0b913ffe 100644 --- a/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice.qpb.cpp +++ b/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "qtgrpc/tests/testservice.qpb.h" -#include +#include #include namespace qtgrpc::tests { diff --git a/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_protobuftyperegistrations.cpp b/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_protobuftyperegistrations.cpp index 7a9d9c95..81f6535e 100644 --- a/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_protobuftyperegistrations.cpp +++ b/tests/auto/grpcgen/data/expected_result/folder/qtgrpc/tests/testservice_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "qtgrpc/tests/testservice.qpb.h" namespace qtgrpc::tests { diff --git a/tests/auto/protobuf/converters/tst_protobuf_converter.cpp b/tests/auto/protobuf/converters/tst_protobuf_converter.cpp index fe6bddf1..ae109432 100644 --- a/tests/auto/protobuf/converters/tst_protobuf_converter.cpp +++ b/tests/auto/protobuf/converters/tst_protobuf_converter.cpp @@ -6,6 +6,7 @@ #include #include +#include class QtProtobufConverterTest : public QObject { diff --git a/tests/auto/protobuf/optional/tst_protobuf_optional.cpp b/tests/auto/protobuf/optional/tst_protobuf_optional.cpp index 9c7035c3..9d67180c 100644 --- a/tests/auto/protobuf/optional/tst_protobuf_optional.cpp +++ b/tests/auto/protobuf/optional/tst_protobuf_optional.cpp @@ -6,6 +6,7 @@ #include #include +#include #include diff --git a/tests/auto/protobufgen/data/expected_result/comments/annotation.qpb.cpp b/tests/auto/protobufgen/data/expected_result/comments/annotation.qpb.cpp index 7ea4ae58..b7b2ca71 100644 --- a/tests/auto/protobufgen/data/expected_result/comments/annotation.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/comments/annotation.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "annotation.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/comments/annotation_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/comments/annotation_protobuftyperegistrations.cpp index d2891d24..d34bd674 100644 --- a/tests/auto/protobufgen/data/expected_result/comments/annotation_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/comments/annotation_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "annotation.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/extra-namespace/extranamespace.qpb.cpp b/tests/auto/protobufgen/data/expected_result/extra-namespace/extranamespace.qpb.cpp index f68b81f5..af86fd9b 100644 --- a/tests/auto/protobufgen/data/expected_result/extra-namespace/extranamespace.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/extra-namespace/extranamespace.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "extranamespace.qpb.h" -#include +#include #include namespace MyTopLevelNamespace::qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/extra-namespace/extranamespace_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/extra-namespace/extranamespace_protobuftyperegistrations.cpp index d3c57b21..62c4ddc3 100644 --- a/tests/auto/protobufgen/data/expected_result/extra-namespace/extranamespace_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/extra-namespace/extranamespace_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "extranamespace.qpb.h" namespace MyTopLevelNamespace::qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/fieldenum/fieldindexrange.qpb.cpp b/tests/auto/protobufgen/data/expected_result/fieldenum/fieldindexrange.qpb.cpp index 795364c3..15005124 100644 --- a/tests/auto/protobufgen/data/expected_result/fieldenum/fieldindexrange.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/fieldenum/fieldindexrange.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "fieldindexrange.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/fieldenum/fieldindexrange_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/fieldenum/fieldindexrange_protobuftyperegistrations.cpp index 1d6fff84..45ede338 100644 --- a/tests/auto/protobufgen/data/expected_result/fieldenum/fieldindexrange_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/fieldenum/fieldindexrange_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "fieldindexrange.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/optional/tests/optional.qpb.cpp b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/optional/tests/optional.qpb.cpp index c13c6e08..392af6c7 100644 --- a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/optional/tests/optional.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/optional/tests/optional.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "qtprotobufnamespace/optional/tests/optional.qpb.h" -#include +#include #include namespace qtprotobufnamespace::optional::tests { diff --git a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/optional/tests/optional_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/optional/tests/optional_protobuftyperegistrations.cpp index ecae383a..ad609b41 100644 --- a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/optional/tests/optional_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/optional/tests/optional_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "qtprotobufnamespace/optional/tests/optional.qpb.h" namespace qtprotobufnamespace::optional::tests { diff --git a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/basicmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/basicmessages.qpb.cpp index 7bb484c5..4881c31c 100644 --- a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/basicmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/basicmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "qtprotobufnamespace/tests/basicmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/basicmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/basicmessages_protobuftyperegistrations.cpp index 18ffcbfd..87761a2a 100644 --- a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/basicmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/basicmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "qtprotobufnamespace/tests/basicmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/mapmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/mapmessages.qpb.cpp index e584498b..9e29616b 100644 --- a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/mapmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/mapmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "qtprotobufnamespace/tests/mapmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/mapmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/mapmessages_protobuftyperegistrations.cpp index 40022998..1fc95520 100644 --- a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/mapmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/mapmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "qtprotobufnamespace/tests/mapmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/oneofmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/oneofmessages.qpb.cpp index 7c087511..80cd79b6 100644 --- a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/oneofmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/oneofmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "qtprotobufnamespace/tests/oneofmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/oneofmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/oneofmessages_protobuftyperegistrations.cpp index 5b258387..2c5a2123 100644 --- a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/oneofmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/oneofmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "qtprotobufnamespace/tests/oneofmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/repeatedmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/repeatedmessages.qpb.cpp index be8400e1..1a580810 100644 --- a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/repeatedmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/repeatedmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "qtprotobufnamespace/tests/repeatedmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/repeatedmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/repeatedmessages_protobuftyperegistrations.cpp index 14a0a219..d33f46c7 100644 --- a/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/repeatedmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/folder/qtprotobufnamespace/tests/repeatedmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "qtprotobufnamespace/tests/repeatedmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/annotation.qpb.cpp b/tests/auto/protobufgen/data/expected_result/no-options/annotation.qpb.cpp index 7ea4ae58..b7b2ca71 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/annotation.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/annotation.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "annotation.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/annotation_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/no-options/annotation_protobuftyperegistrations.cpp index d2891d24..d34bd674 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/annotation_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/annotation_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "annotation.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/anymessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/no-options/anymessages.qpb.cpp index d9f9967e..e34a942b 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/anymessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/anymessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "anymessages.qpb.h" -#include +#include #include namespace qtproto::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/anymessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/no-options/anymessages_protobuftyperegistrations.cpp index 21ce1c13..97212152 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/anymessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/anymessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "anymessages.qpb.h" namespace qtproto::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/basicmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/no-options/basicmessages.qpb.cpp index 7412a370..5ccebf15 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/basicmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/basicmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "basicmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/basicmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/no-options/basicmessages_protobuftyperegistrations.cpp index 75ef8200..87282948 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/basicmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/basicmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "basicmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/extranamespace.qpb.cpp b/tests/auto/protobufgen/data/expected_result/no-options/extranamespace.qpb.cpp index 74a0b597..f986334b 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/extranamespace.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/extranamespace.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "extranamespace.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/extranamespace_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/no-options/extranamespace_protobuftyperegistrations.cpp index dffec10d..0a1ee063 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/extranamespace_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/extranamespace_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "extranamespace.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/fieldindexrange.qpb.cpp b/tests/auto/protobufgen/data/expected_result/no-options/fieldindexrange.qpb.cpp index 795364c3..15005124 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/fieldindexrange.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/fieldindexrange.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "fieldindexrange.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/fieldindexrange_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/no-options/fieldindexrange_protobuftyperegistrations.cpp index 1d6fff84..45ede338 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/fieldindexrange_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/fieldindexrange_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "fieldindexrange.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/mapmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/no-options/mapmessages.qpb.cpp index 306abdc8..90c56680 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/mapmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/mapmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "mapmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/mapmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/no-options/mapmessages_protobuftyperegistrations.cpp index d43af5d9..36164195 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/mapmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/mapmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "mapmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/oneofmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/no-options/oneofmessages.qpb.cpp index 3dba49b9..5edef31d 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/oneofmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/oneofmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "oneofmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/oneofmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/no-options/oneofmessages_protobuftyperegistrations.cpp index 2251f0fd..fad658f7 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/oneofmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/oneofmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "oneofmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/optional.qpb.cpp b/tests/auto/protobufgen/data/expected_result/no-options/optional.qpb.cpp index 8e57ccb5..098de9f6 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/optional.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/optional.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "optional.qpb.h" -#include +#include #include namespace qtprotobufnamespace::optional::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/optional_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/no-options/optional_protobuftyperegistrations.cpp index 5a5000dd..91a636bd 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/optional_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/optional_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "optional.qpb.h" namespace qtprotobufnamespace::optional::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/repeatedmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/no-options/repeatedmessages.qpb.cpp index a98614e8..1f7aca82 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/repeatedmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/repeatedmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "repeatedmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/repeatedmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/no-options/repeatedmessages_protobuftyperegistrations.cpp index e58c882f..e424fbe0 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/repeatedmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/repeatedmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "repeatedmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/repeatednonpackedmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/no-options/repeatednonpackedmessages.qpb.cpp index 81abb589..c284472f 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/repeatednonpackedmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/repeatednonpackedmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "repeatednonpackedmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/no-options/repeatednonpackedmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/no-options/repeatednonpackedmessages_protobuftyperegistrations.cpp index 672af915..acf3d5dc 100644 --- a/tests/auto/protobufgen/data/expected_result/no-options/repeatednonpackedmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/no-options/repeatednonpackedmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "repeatednonpackedmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/packed/repeatednonpackedmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/packed/repeatednonpackedmessages.qpb.cpp index 81abb589..c284472f 100644 --- a/tests/auto/protobufgen/data/expected_result/packed/repeatednonpackedmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/packed/repeatednonpackedmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "repeatednonpackedmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/packed/repeatednonpackedmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/packed/repeatednonpackedmessages_protobuftyperegistrations.cpp index 672af915..acf3d5dc 100644 --- a/tests/auto/protobufgen/data/expected_result/packed/repeatednonpackedmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/packed/repeatednonpackedmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "repeatednonpackedmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackage.qpb.cpp b/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackage.qpb.cpp index de927345..89e14e2d 100644 --- a/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackage.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackage.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "nopackage.qpb.h" -#include +#include #include static QtProtobuf::ProtoTypeRegistrar ProtoTypeRegistrarTestEnumGadget(TestEnumGadget::registerTypes); diff --git a/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackage_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackage_protobuftyperegistrations.cpp index 3676e2cf..2b97fbcd 100644 --- a/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackage_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackage_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "nopackage.qpb.h" static QtProtobuf::ProtoTypeRegistrar ProtoTypeRegistrarEmptyMessage(qRegisterProtobufType); diff --git a/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackageexternal.qpb.cpp b/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackageexternal.qpb.cpp index 1fa9e680..8708ca7b 100644 --- a/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackageexternal.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackageexternal.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "nopackageexternal.qpb.h" -#include +#include #include diff --git a/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackageexternal_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackageexternal_protobuftyperegistrations.cpp index 40179bb3..253aed7e 100644 --- a/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackageexternal_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/qml-no-package/nopackageexternal_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "nopackageexternal.qpb.h" static QtProtobuf::ProtoTypeRegistrar ProtoTypeRegistrarSimpleIntMessageExt(qRegisterProtobufType); diff --git a/tests/auto/protobufgen/data/expected_result/qmlgen/basicmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/qmlgen/basicmessages.qpb.cpp index 7412a370..5ccebf15 100644 --- a/tests/auto/protobufgen/data/expected_result/qmlgen/basicmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/qmlgen/basicmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "basicmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/qmlgen/basicmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/qmlgen/basicmessages_protobuftyperegistrations.cpp index 75ef8200..87282948 100644 --- a/tests/auto/protobufgen/data/expected_result/qmlgen/basicmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/qmlgen/basicmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "basicmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/qmlgen/enummessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/qmlgen/enummessages.qpb.cpp index 3f03e0f3..92843215 100644 --- a/tests/auto/protobufgen/data/expected_result/qmlgen/enummessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/qmlgen/enummessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "enummessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/qmlgen/enummessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/qmlgen/enummessages_protobuftyperegistrations.cpp index a3a03fb7..e2526818 100644 --- a/tests/auto/protobufgen/data/expected_result/qmlgen/enummessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/qmlgen/enummessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "enummessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/qmlgen/oneofmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/qmlgen/oneofmessages.qpb.cpp index 3dba49b9..5edef31d 100644 --- a/tests/auto/protobufgen/data/expected_result/qmlgen/oneofmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/qmlgen/oneofmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "oneofmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/qmlgen/oneofmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/qmlgen/oneofmessages_protobuftyperegistrations.cpp index 2251f0fd..fad658f7 100644 --- a/tests/auto/protobufgen/data/expected_result/qmlgen/oneofmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/qmlgen/oneofmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "oneofmessages.qpb.h" namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/qmlgen/repeatedmessages.qpb.cpp b/tests/auto/protobufgen/data/expected_result/qmlgen/repeatedmessages.qpb.cpp index a98614e8..1f7aca82 100644 --- a/tests/auto/protobufgen/data/expected_result/qmlgen/repeatedmessages.qpb.cpp +++ b/tests/auto/protobufgen/data/expected_result/qmlgen/repeatedmessages.qpb.cpp @@ -1,7 +1,7 @@ /* This file is autogenerated. DO NOT CHANGE. All changes will be lost */ #include "repeatedmessages.qpb.h" -#include +#include #include namespace qtprotobufnamespace::tests { diff --git a/tests/auto/protobufgen/data/expected_result/qmlgen/repeatedmessages_protobuftyperegistrations.cpp b/tests/auto/protobufgen/data/expected_result/qmlgen/repeatedmessages_protobuftyperegistrations.cpp index e58c882f..e424fbe0 100644 --- a/tests/auto/protobufgen/data/expected_result/qmlgen/repeatedmessages_protobuftyperegistrations.cpp +++ b/tests/auto/protobufgen/data/expected_result/qmlgen/repeatedmessages_protobuftyperegistrations.cpp @@ -1,4 +1,4 @@ -#include +#include #include "repeatedmessages.qpb.h" namespace qtprotobufnamespace::tests {