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>
This commit is contained in:
parent
89e92a11e7
commit
3f8e3c3335
@ -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),
|
||||
|
@ -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 "";
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user