From 48c8322a613f58d19ad9e0262bbac437ce2598f8 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 22 Jun 2020 11:23:43 +0200 Subject: Use QList instead of QVector in dbus Omitted type replacement in qDBusParametersForMethod() for now. Task-number: QTBUG-84469 Change-Id: Ieb9fbb30b431c5e4183ad57acd35640e9556bf6c Reviewed-by: Lars Knoll --- src/dbus/qdbusmetatype.cpp | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'src/dbus/qdbusmetatype.cpp') diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp index bcbb22fba6..699e1d5076 100644 --- a/src/dbus/qdbusmetatype.cpp +++ b/src/dbus/qdbusmetatype.cpp @@ -45,8 +45,8 @@ #include #include +#include #include -#include #include "qdbusargument_p.h" #include "qdbusutil_p.h" @@ -131,25 +131,13 @@ void QDBusMetaTypeId::init() qDBusRegisterMetaType >(); qDBusRegisterMetaType >(); qDBusRegisterMetaType >(); - - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); - qDBusRegisterMetaType >(); #endif initialized.storeRelaxed(true); } } -Q_GLOBAL_STATIC(QVector, customTypes) +Q_GLOBAL_STATIC(QList, customTypes) Q_GLOBAL_STATIC(QReadWriteLock, customTypesLock) /*! @@ -228,7 +216,7 @@ Q_GLOBAL_STATIC(QReadWriteLock, customTypesLock) void QDBusMetaType::registerMarshallOperators(int id, MarshallFunction mf, DemarshallFunction df) { - QVector *ct = customTypes(); + QList *ct = customTypes(); if (id < 0 || !mf || !df || !ct) return; // error! @@ -253,7 +241,7 @@ bool QDBusMetaType::marshall(QDBusArgument &arg, int id, const void *data) MarshallFunction mf; { QReadLocker locker(customTypesLock()); - QVector *ct = customTypes(); + QList *ct = customTypes(); if (id >= ct->size()) return false; // non-existent @@ -282,7 +270,7 @@ bool QDBusMetaType::demarshall(const QDBusArgument &arg, int id, void *data) DemarshallFunction df; { QReadLocker locker(customTypesLock()); - QVector *ct = customTypes(); + QList *ct = customTypes(); if (id >= ct->size()) return false; // non-existent @@ -456,7 +444,7 @@ const char *QDBusMetaType::typeToSignature(int type) return DBUS_TYPE_UNIX_FD_AS_STRING; // try the database - QVector *ct = customTypes(); + QList *ct = customTypes(); { QReadLocker locker(customTypesLock()); if (type >= ct->size()) -- cgit v1.2.3