diff options
author | Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> | 2022-10-14 11:39:07 -0400 |
---|---|---|
committer | Maxime Roussin-Bélanger <maxime.roussinbelanger@gmail.com> | 2022-10-21 12:02:34 -0400 |
commit | 3f8e3c3335c57bc9d44ee119868c6489c772a3e3 (patch) | |
tree | 4c154d7b40602090ac8dc494bbaf58f187f25e72 | |
parent | 89e92a11e7b43a4f99c5a45f2cc641b3b59f5bcc (diff) | |
download | qtbase-3f8e3c3335c57bc9d44ee119868c6489c772a3e3.tar.gz |
dbus: use same type of matching quotes
There is no reason to use different style of quotes when printing
messages.
Change-Id: I7d513ec04c803702974054569d28f26947942fbf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/dbus/qdbusabstractinterface.cpp | 8 | ||||
-rw-r--r-- | src/dbus/qdbusargument.cpp | 10 | ||||
-rw-r--r-- | src/dbus/qdbusinternalfilters.cpp | 2 | ||||
-rw-r--r-- | src/dbus/qdbusmarshaller.cpp | 2 | ||||
-rw-r--r-- | tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp | 4 | ||||
-rw-r--r-- | tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp | 16 |
6 files changed, 20 insertions, 22 deletions
diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp index 363ec83cce..60984c99a0 100644 --- a/src/dbus/qdbusabstractinterface.cpp +++ b/src/dbus/qdbusabstractinterface.cpp @@ -148,8 +148,8 @@ bool QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp, void *retu return false; } if (reply.signature() != "v"_L1) { - QString errmsg = "Invalid signature `%1' in return from call to " - DBUS_INTERFACE_PROPERTIES ""_L1; + QString errmsg = + "Invalid signature '%1' in return from call to " DBUS_INTERFACE_PROPERTIES ""_L1; lastError = QDBusError(QDBusError::InvalidSignature, std::move(errmsg).arg(reply.signature())); return false; } @@ -185,8 +185,8 @@ bool QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp, void *retu } // there was an error... - const auto errmsg = "Unexpected `%1' (%2) when retrieving property `%3.%4' " - "(expected type `%5' (%6))"_L1; + const auto errmsg = "Unexpected '%1' (%2) when retrieving property '%3.%4' " + "(expected type '%5' (%6))"_L1; lastError = QDBusError(QDBusError::InvalidSignature, errmsg.arg(QLatin1StringView(foundType), QLatin1StringView(foundSignature), diff --git a/src/dbus/qdbusargument.cpp b/src/dbus/qdbusargument.cpp index 86ce83b324..4190c7ccb1 100644 --- a/src/dbus/qdbusargument.cpp +++ b/src/dbus/qdbusargument.cpp @@ -50,18 +50,16 @@ QByteArray QDBusArgumentPrivate::createSignature(int id) delete marshaller; if (signature.isEmpty() || !ok || !QDBusUtil::isValidSingleSignature(QString::fromLatin1(signature))) { - qWarning("QDBusMarshaller: type `%s' produces invalid D-BUS signature `%s' " + qWarning("QDBusMarshaller: type '%s' produces invalid D-BUS signature '%s' " "(Did you forget to call beginStructure() ?)", - QMetaType(id).name(), - signature.isEmpty() ? "<empty>" : signature.constData()); + QMetaType(id).name(), signature.isEmpty() ? "<empty>" : signature.constData()); return ""; } else if ((signature.at(0) != DBUS_TYPE_ARRAY && signature.at(0) != DBUS_STRUCT_BEGIN_CHAR) || (signature.at(0) == DBUS_TYPE_ARRAY && (signature.at(1) == DBUS_TYPE_BYTE || signature.at(1) == DBUS_TYPE_STRING))) { - qWarning("QDBusMarshaller: type `%s' attempts to redefine basic D-BUS type '%s' (%s) " + qWarning("QDBusMarshaller: type '%s' attempts to redefine basic D-BUS type '%s' (%s) " "(Did you forget to call beginStructure() ?)", - QMetaType(id).name(), - signature.constData(), + QMetaType(id).name(), signature.constData(), QDBusMetaType::signatureToMetaType(signature).name()); return ""; } diff --git a/src/dbus/qdbusinternalfilters.cpp b/src/dbus/qdbusinternalfilters.cpp index 24b791409a..dae07923b5 100644 --- a/src/dbus/qdbusinternalfilters.cpp +++ b/src/dbus/qdbusinternalfilters.cpp @@ -326,7 +326,7 @@ static int writeProperty(QObject *obj, const QByteArray &property_name, QVariant // we have to demarshall before writing QVariant other{QMetaType(id)}; if (!QDBusMetaType::demarshall(qvariant_cast<QDBusArgument>(value), other.metaType(), other.data())) { - qWarning("QDBusConnection: type `%s' (%d) is not registered with QtDBus. " + qWarning("QDBusConnection: type '%s' (%d) is not registered with QtDBus. " "Use qDBusRegisterMetaType to register it", mp.typeName(), id.id()); return PropertyWriteFailed; diff --git a/src/dbus/qdbusmarshaller.cpp b/src/dbus/qdbusmarshaller.cpp index 55f474568b..e3fb298fbe 100644 --- a/src/dbus/qdbusmarshaller.cpp +++ b/src/dbus/qdbusmarshaller.cpp @@ -28,7 +28,7 @@ QDBusMarshaller::~QDBusMarshaller() void QDBusMarshaller::unregisteredTypeError(QMetaType id) { const char *name = id.name(); - qWarning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. " + qWarning("QDBusMarshaller: type '%s' (%d) is not registered with D-BUS. " "Use qDBusRegisterMetaType to register it", name ? name : "", id.id()); error("Unregistered type %1 passed in arguments"_L1 diff --git a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp index dc55c09f2a..bb5575d66a 100644 --- a/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp +++ b/tests/auto/dbus/qdbusmarshall/tst_qdbusmarshall.cpp @@ -962,7 +962,7 @@ void tst_QDBusMarshall::sendCallErrors_data() << (QVariantList() << QLocale::c()) << "org.freedesktop.DBus.Error.Failed" << "Marshalling failed: Unregistered type QLocale passed in arguments" - << "QDBusMarshaller: type `QLocale' (18) is not registered with D-BUS. Use qDBusRegisterMetaType to register it"; + << "QDBusMarshaller: type 'QLocale' (18) is not registered with D-BUS. Use qDBusRegisterMetaType to register it"; // this type is known to the meta type system, but not registered with D-Bus qRegisterMetaType<UnregisteredType>(); @@ -970,7 +970,7 @@ void tst_QDBusMarshall::sendCallErrors_data() << (QVariantList() << QVariant::fromValue(UnregisteredType())) << "org.freedesktop.DBus.Error.Failed" << "Marshalling failed: Unregistered type UnregisteredType passed in arguments" - << QString("QDBusMarshaller: type `UnregisteredType' (%1) is not registered with D-BUS. Use qDBusRegisterMetaType to register it") + << QString("QDBusMarshaller: type 'UnregisteredType' (%1) is not registered with D-BUS. Use qDBusRegisterMetaType to register it") .arg(qMetaTypeId<UnregisteredType>()); QTest::newRow("invalid-object-path-arg") << serviceName << objectPath << interfaceName << "ping" diff --git a/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp b/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp index c2df3bc678..8749d88536 100644 --- a/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp +++ b/tests/auto/dbus/qdbusmetatype/tst_qdbusmetatype.cpp @@ -365,21 +365,21 @@ void tst_QDBusMetaType::invalidTypes() { // same test if (qstrcmp(QTest::currentDataTag(), "Invalid0") == 0) - QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type `Invalid0' produces invalid D-BUS signature `<empty>' (Did you forget to call beginStructure() ?)"); + QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type 'Invalid0' produces invalid D-BUS signature '<empty>' (Did you forget to call beginStructure() ?)"); else if (qstrcmp(QTest::currentDataTag(), "Invalid1") == 0) - QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type `Invalid1' attempts to redefine basic D-BUS type 's' (QString) (Did you forget to call beginStructure() ?)"); + QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type 'Invalid1' attempts to redefine basic D-BUS type 's' (QString) (Did you forget to call beginStructure() ?)"); else if (qstrcmp(QTest::currentDataTag(), "Invalid2") == 0) - QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type `Invalid2' attempts to redefine basic D-BUS type 'o' (QDBusObjectPath) (Did you forget to call beginStructure() ?)"); + QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type 'Invalid2' attempts to redefine basic D-BUS type 'o' (QDBusObjectPath) (Did you forget to call beginStructure() ?)"); else if (qstrcmp(QTest::currentDataTag(), "Invalid3") == 0) - QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type `Invalid3' attempts to redefine basic D-BUS type 'as' (QStringList) (Did you forget to call beginStructure() ?)"); + QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type 'Invalid3' attempts to redefine basic D-BUS type 'as' (QStringList) (Did you forget to call beginStructure() ?)"); else if (qstrcmp(QTest::currentDataTag(), "Invalid4") == 0) - QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type `Invalid4' attempts to redefine basic D-BUS type 'ay' (QByteArray) (Did you forget to call beginStructure() ?)"); + QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type 'Invalid4' attempts to redefine basic D-BUS type 'ay' (QByteArray) (Did you forget to call beginStructure() ?)"); else if (qstrcmp(QTest::currentDataTag(), "Invalid5") == 0) - QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type `Invalid5' produces invalid D-BUS signature `ii' (Did you forget to call beginStructure() ?)"); + QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type 'Invalid5' produces invalid D-BUS signature 'ii' (Did you forget to call beginStructure() ?)"); else if (qstrcmp(QTest::currentDataTag(), "Invalid7") == 0) - QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type `Invalid7' produces invalid D-BUS signature `()' (Did you forget to call beginStructure() ?)"); + QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type 'Invalid7' produces invalid D-BUS signature '()' (Did you forget to call beginStructure() ?)"); else if (qstrcmp(QTest::currentDataTag(), "QList<Invalid0>") == 0) - QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type `QList<Invalid0>' produces invalid D-BUS signature `a' (Did you forget to call beginStructure() ?)"); + QTest::ignoreMessage(QtWarningMsg, "QDBusMarshaller: type 'QList<Invalid0>' produces invalid D-BUS signature 'a' (Did you forget to call beginStructure() ?)"); staticTypes(); staticTypes(); // run twice: the error messages should be printed once only |