QtDBus: replace remaining uses of QLatin1String with QLatin1StringView
Task-number: QTBUG-98434 Change-Id: I733af3126f126e5025f709cfe023b9f6bbc13e3e Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>bb10
parent
e9e43bff29
commit
9662c7da8f
|
|
@ -103,7 +103,7 @@ public: // typedefs
|
|||
inline bool operator<(const AdaptorData &other) const
|
||||
{ return QByteArray(interface) < other.interface; }
|
||||
inline bool operator<(const QString &other) const
|
||||
{ return QLatin1String(interface) < other; }
|
||||
{ return QLatin1StringView(interface) < other; }
|
||||
inline bool operator<(const QByteArray &other) const
|
||||
{ return interface < other; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ bool QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp, void *retu
|
|||
"used to read property %s.%s",
|
||||
mp.typeName(), qPrintable(interface), mp.name());
|
||||
lastError = QDBusError(QDBusError::Failed, "Unregistered type %1 cannot be handled"_L1
|
||||
.arg(QLatin1String(mp.typeName())));
|
||||
.arg(QLatin1StringView(mp.typeName())));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -224,12 +224,12 @@ bool QDBusAbstractInterfacePrivate::property(const QMetaProperty &mp, void *retu
|
|||
const auto errmsg = "Unexpected `%1' (%2) when retrieving property `%3.%4' "
|
||||
"(expected type `%5' (%6))"_L1;
|
||||
lastError = QDBusError(QDBusError::InvalidSignature,
|
||||
errmsg.arg(QLatin1String(foundType),
|
||||
QLatin1String(foundSignature),
|
||||
errmsg.arg(QLatin1StringView(foundType),
|
||||
QLatin1StringView(foundSignature),
|
||||
interface,
|
||||
QLatin1String(mp.name()),
|
||||
QLatin1String(mp.typeName()),
|
||||
QLatin1String(expectedSignature)));
|
||||
QLatin1StringView(mp.name()),
|
||||
QLatin1StringView(mp.typeName()),
|
||||
QLatin1StringView(expectedSignature)));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ QDBusError::QDBusError(const QDBusMessage &qdmsg)
|
|||
QDBusError::QDBusError(ErrorType error, const QString &mess)
|
||||
: code(error)
|
||||
{
|
||||
nm = QLatin1String(errorMessages[error]);
|
||||
nm = QLatin1StringView(errorMessages[error]);
|
||||
msg = mess;
|
||||
}
|
||||
|
||||
|
|
@ -336,7 +336,7 @@ bool QDBusError::isValid() const
|
|||
*/
|
||||
QString QDBusError::errorString(ErrorType error)
|
||||
{
|
||||
return QLatin1String(errorMessages[error]);
|
||||
return QLatin1StringView(errorMessages[error]);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ void QDBusSignature::doCheck()
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn QDBusObjectPath::QDBusObjectPath(QLatin1String path)
|
||||
\fn QDBusObjectPath::QDBusObjectPath(QLatin1StringView path)
|
||||
|
||||
Constructs a new object path from the given \a path.
|
||||
*/
|
||||
|
|
@ -204,7 +204,7 @@ QDBusObjectPath::operator QVariant() const { return QVariant::fromValue(*this);
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn QDBusSignature::QDBusSignature(QLatin1String signature)
|
||||
\fn QDBusSignature::QDBusSignature(QLatin1StringView signature)
|
||||
|
||||
Constructs a new signature from the given \a signature.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public:
|
|||
// compiler-generated destructor is ok!
|
||||
|
||||
inline explicit QDBusObjectPath(const char *path);
|
||||
inline explicit QDBusObjectPath(QLatin1String path);
|
||||
inline explicit QDBusObjectPath(QLatin1StringView path);
|
||||
inline explicit QDBusObjectPath(const QString &path);
|
||||
explicit QDBusObjectPath(QString &&p) : m_path(std::move(p)) { doCheck(); }
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ inline QDBusObjectPath::QDBusObjectPath(const char *objectPath)
|
|||
: m_path(QString::fromLatin1(objectPath))
|
||||
{ doCheck(); }
|
||||
|
||||
inline QDBusObjectPath::QDBusObjectPath(QLatin1String objectPath)
|
||||
inline QDBusObjectPath::QDBusObjectPath(QLatin1StringView objectPath)
|
||||
: m_path(objectPath)
|
||||
{ doCheck(); }
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ public:
|
|||
// compiler-generated destructor is ok!
|
||||
|
||||
inline explicit QDBusSignature(const char *signature);
|
||||
inline explicit QDBusSignature(QLatin1String signature);
|
||||
inline explicit QDBusSignature(QLatin1StringView signature);
|
||||
inline explicit QDBusSignature(const QString &signature);
|
||||
explicit QDBusSignature(QString &&sig) : m_signature(std::move(sig)) { doCheck(); }
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ inline QDBusSignature::QDBusSignature(const char *dBusSignature)
|
|||
: m_signature(QString::fromLatin1(dBusSignature))
|
||||
{ doCheck(); }
|
||||
|
||||
inline QDBusSignature::QDBusSignature(QLatin1String dBusSignature)
|
||||
inline QDBusSignature::QDBusSignature(QLatin1StringView dBusSignature)
|
||||
: m_signature(dBusSignature)
|
||||
{ doCheck(); }
|
||||
|
||||
|
|
|
|||
|
|
@ -1281,7 +1281,7 @@ void QDBusConnectionPrivate::relaySignal(QObject *obj, const QMetaObject *mo, in
|
|||
checkThread();
|
||||
QDBusReadLocker locker(RelaySignalAction, this);
|
||||
QDBusMessage message = QDBusMessage::createSignal("/"_L1, interface,
|
||||
QLatin1String(memberName));
|
||||
QLatin1StringView(memberName));
|
||||
QDBusMessagePrivate::setParametersValidated(message, true);
|
||||
message.setArguments(args);
|
||||
QDBusError error;
|
||||
|
|
@ -1371,7 +1371,7 @@ bool QDBusConnectionPrivate::prepareHook(QDBusConnectionPrivate::SignalHook &hoo
|
|||
hook.signature.clear();
|
||||
for (int i = 1; i < hook.params.count(); ++i)
|
||||
if (hook.params.at(i) != QDBusMetaTypeId::message())
|
||||
hook.signature += QLatin1String( QDBusMetaType::typeToSignature( hook.params.at(i) ) );
|
||||
hook.signature += QLatin1StringView(QDBusMetaType::typeToSignature(hook.params.at(i)));
|
||||
}
|
||||
|
||||
hook.matchRule = buildMatchRule(service, path, interface, mname, argMatch, hook.signature);
|
||||
|
|
@ -1495,7 +1495,7 @@ void QDBusConnectionPrivate::activateObject(ObjectTreeNode &node, const QDBusMes
|
|||
QDBusAdaptorConnector::AdaptorMap::ConstIterator it;
|
||||
it = std::lower_bound(connector->adaptors.constBegin(), connector->adaptors.constEnd(),
|
||||
msg.interface());
|
||||
if (it != connector->adaptors.constEnd() && msg.interface() == QLatin1String(it->interface)) {
|
||||
if (it != connector->adaptors.constEnd() && msg.interface() == QLatin1StringView(it->interface)) {
|
||||
if (!activateCall(it->adaptor, newflags, msg))
|
||||
sendError(msg, QDBusError::UnknownMethod);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ static void copyArgument(void *to, int id, const QVariant &arg)
|
|||
|
||||
// is it the same signature?
|
||||
QDBusArgument dbarg = qvariant_cast<QDBusArgument>(arg);
|
||||
if (dbarg.currentSignature() != QLatin1String(userSignature)) {
|
||||
if (dbarg.currentSignature() != QLatin1StringView(userSignature)) {
|
||||
// not the same signature, another mismatch
|
||||
//qWarning?
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -177,11 +177,11 @@ QString qDBusIntrospectObject(const QDBusConnectionPrivate::ObjectTreeNode &node
|
|||
xml_data += node.treeNode->introspect(path);
|
||||
}
|
||||
|
||||
xml_data += QLatin1String( propertiesInterfaceXml );
|
||||
xml_data += QLatin1StringView(propertiesInterfaceXml);
|
||||
}
|
||||
|
||||
xml_data += QLatin1String( introspectableInterfaceXml );
|
||||
xml_data += QLatin1String( peerInterfaceXml );
|
||||
xml_data += QLatin1StringView(introspectableInterfaceXml);
|
||||
xml_data += QLatin1StringView(peerInterfaceXml);
|
||||
|
||||
if (node.flags & QDBusConnection::ExportChildObjects) {
|
||||
xml_data += generateSubObjectXml(node.obj);
|
||||
|
|
@ -216,7 +216,7 @@ propertyNotFoundError(const QDBusMessage &msg, const QString &interface_name, co
|
|||
"Property %1%2%3 was not found in object %4"_L1
|
||||
.arg(interface_name,
|
||||
interface_name.isEmpty() ? ""_L1 : "."_L1,
|
||||
QLatin1String(property_name),
|
||||
QLatin1StringView(property_name),
|
||||
msg.path()));
|
||||
}
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ QDBusMessage qDBusPropertyGet(const QDBusConnectionPrivate::ObjectTreeNode &node
|
|||
QDBusAdaptorConnector::AdaptorMap::ConstIterator it;
|
||||
it = std::lower_bound(connector->adaptors.constBegin(), connector->adaptors.constEnd(),
|
||||
interface_name);
|
||||
if (it != connector->adaptors.constEnd() && interface_name == QLatin1String(it->interface)) {
|
||||
if (it != connector->adaptors.constEnd() && interface_name == QLatin1StringView(it->interface)) {
|
||||
interfaceFound = true;
|
||||
value = it->adaptor->property(property_name);
|
||||
}
|
||||
|
|
@ -307,13 +307,13 @@ static QDBusMessage propertyWriteReply(const QDBusMessage &msg, const QString &i
|
|||
"Invalid arguments for writing to property %1%2%3"_L1
|
||||
.arg(interface_name,
|
||||
interface_name.isEmpty() ? ""_L1 : "."_L1,
|
||||
QLatin1String(property_name)));
|
||||
QLatin1StringView(property_name)));
|
||||
case PropertyReadOnly:
|
||||
return msg.createErrorReply(QDBusError::PropertyReadOnly,
|
||||
"Property %1%2%3 is read-only"_L1
|
||||
.arg(interface_name,
|
||||
interface_name.isEmpty() ? ""_L1 : "."_L1,
|
||||
QLatin1String(property_name)));
|
||||
QLatin1StringView(property_name)));
|
||||
case PropertyWriteFailed:
|
||||
return msg.createErrorReply(QDBusError::InternalError,
|
||||
QString::fromLatin1("Internal error"));
|
||||
|
|
@ -408,7 +408,7 @@ QDBusMessage qDBusPropertySet(const QDBusConnectionPrivate::ObjectTreeNode &node
|
|||
QDBusAdaptorConnector::AdaptorMap::ConstIterator it;
|
||||
it = std::lower_bound(connector->adaptors.constBegin(), connector->adaptors.constEnd(),
|
||||
interface_name);
|
||||
if (it != connector->adaptors.cend() && interface_name == QLatin1String(it->interface)) {
|
||||
if (it != connector->adaptors.cend() && interface_name == QLatin1StringView(it->interface)) {
|
||||
return propertyWriteReply(msg, interface_name, property_name,
|
||||
writeProperty(it->adaptor, property_name, value));
|
||||
}
|
||||
|
|
@ -506,7 +506,7 @@ QDBusMessage qDBusPropertyGetAll(const QDBusConnectionPrivate::ObjectTreeNode &n
|
|||
QDBusAdaptorConnector::AdaptorMap::ConstIterator it;
|
||||
it = std::lower_bound(connector->adaptors.constBegin(), connector->adaptors.constEnd(),
|
||||
interface_name);
|
||||
if (it != connector->adaptors.constEnd() && interface_name == QLatin1String(it->interface)) {
|
||||
if (it != connector->adaptors.constEnd() && interface_name == QLatin1StringView(it->interface)) {
|
||||
interfaceFound = true;
|
||||
result = readAllProperties(it->adaptor, QDBusConnection::ExportAllProperties);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ void QDBusMarshaller::unregisteredTypeError(QMetaType id)
|
|||
"Use qDBusRegisterMetaType to register it",
|
||||
name ? name : "", id.id());
|
||||
error("Unregistered type %1 passed in arguments"_L1
|
||||
.arg(QLatin1String(id.name())));
|
||||
.arg(QLatin1StringView(id.name())));
|
||||
}
|
||||
|
||||
inline QString QDBusMarshaller::currentSignature()
|
||||
|
|
@ -276,7 +276,7 @@ inline QDBusMarshaller *QDBusMarshaller::beginMap(QMetaType kid, QMetaType vid)
|
|||
qWarning("QDBusMarshaller: type '%s' (%d) cannot be used as the key type in a D-BUS map.",
|
||||
kid.name(), kid.id());
|
||||
error("Type %1 passed in arguments cannot be used as a key in a map"_L1
|
||||
.arg(QLatin1String(kid.name())));
|
||||
.arg(QLatin1StringView(kid.name())));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ QDBusMessage QDBusMessagePrivate::makeLocal(const QDBusConnectionPrivate &conn,
|
|||
retval.d_ptr->service = conn.baseService;
|
||||
return retval;
|
||||
} else {
|
||||
computedSignature += QLatin1String(signature);
|
||||
computedSignature += QLatin1StringView(signature);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature,
|
|||
QString annotationName = QString::fromLatin1("org.qtproject.QtDBus.QtTypeName");
|
||||
if (id >= 0)
|
||||
annotationName += QString::fromLatin1(".%1%2")
|
||||
.arg(QLatin1String(direction))
|
||||
.arg(QLatin1StringView(direction))
|
||||
.arg(id);
|
||||
|
||||
// extract from annotations:
|
||||
|
|
@ -191,7 +191,7 @@ QDBusMetaObjectGenerator::findType(const QByteArray &signature,
|
|||
annotationName = QString::fromLatin1("com.trolltech.QtDBus.QtTypeName");
|
||||
if (id >= 0)
|
||||
annotationName += QString::fromLatin1(".%1%2")
|
||||
.arg(QLatin1String(direction))
|
||||
.arg(QLatin1StringView(direction))
|
||||
.arg(id);
|
||||
typeName = annotations.value(annotationName).toLatin1();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,9 +80,9 @@ QString qDBusInterfaceFromMetaObject(const QMetaObject *mo)
|
|||
|
||||
int idx = mo->indexOfClassInfo(QCLASSINFO_DBUS_INTERFACE);
|
||||
if (idx >= mo->classInfoOffset()) {
|
||||
interface = QLatin1String(mo->classInfo(idx).value());
|
||||
interface = QLatin1StringView(mo->classInfo(idx).value());
|
||||
} else {
|
||||
interface = QLatin1String(mo->className());
|
||||
interface = QLatin1StringView(mo->className());
|
||||
interface.replace("::"_L1, "."_L1);
|
||||
|
||||
if (interface.startsWith("QDBus"_L1)) {
|
||||
|
|
@ -158,7 +158,7 @@ int qDBusParametersForMethod(const QList<QByteArray> ¶meterTypes, QList<QMet
|
|||
for ( ; it != end; ++it) {
|
||||
QByteArray type = *it;
|
||||
if (type.endsWith('*')) {
|
||||
errorMsg = "Pointers are not supported: "_L1 + QLatin1String(type);
|
||||
errorMsg = "Pointers are not supported: "_L1 + QLatin1StringView(type);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -168,7 +168,7 @@ int qDBusParametersForMethod(const QList<QByteArray> ¶meterTypes, QList<QMet
|
|||
|
||||
QMetaType id = QMetaType::fromName(basictype);
|
||||
if (!id.isValid()) {
|
||||
errorMsg = "Unregistered output type in parameter list: "_L1 + QLatin1String(type);
|
||||
errorMsg = "Unregistered output type in parameter list: "_L1 + QLatin1StringView(type);
|
||||
return -1;
|
||||
} else if (QDBusMetaType::typeToSignature(id) == nullptr)
|
||||
return -1;
|
||||
|
|
@ -179,7 +179,7 @@ int qDBusParametersForMethod(const QList<QByteArray> ¶meterTypes, QList<QMet
|
|||
}
|
||||
|
||||
if (seenMessage) { // && !type.endsWith('&')
|
||||
errorMsg = "Invalid method, non-output parameters after message or after output parameters: "_L1 + QLatin1String(type);
|
||||
errorMsg = "Invalid method, non-output parameters after message or after output parameters: "_L1 + QLatin1StringView(type);
|
||||
return -1; // not allowed
|
||||
}
|
||||
|
||||
|
|
@ -195,14 +195,14 @@ int qDBusParametersForMethod(const QList<QByteArray> ¶meterTypes, QList<QMet
|
|||
#endif
|
||||
|
||||
if (!id.isValid()) {
|
||||
errorMsg = "Unregistered input type in parameter list: "_L1 + QLatin1String(type);
|
||||
errorMsg = "Unregistered input type in parameter list: "_L1 + QLatin1StringView(type);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (id == QDBusMetaTypeId::message())
|
||||
seenMessage = true;
|
||||
else if (QDBusMetaType::typeToSignature(id) == nullptr) {
|
||||
errorMsg = "Type not registered with QtDBus in parameter list: "_L1 + QLatin1String(type);
|
||||
errorMsg = "Type not registered with QtDBus in parameter list: "_L1 + QLatin1StringView(type);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -238,15 +238,15 @@ void qDBusReplyFill(const QDBusMessage &reply, QDBusError &error, QVariant &data
|
|||
QString errorMsg;
|
||||
if (receivedType) {
|
||||
errorMsg = "Unexpected reply signature: got \"%1\" (%4), expected \"%2\" (%3)"_L1
|
||||
.arg(QLatin1String(receivedSignature),
|
||||
QLatin1String(expectedSignature),
|
||||
QLatin1String(data.typeName()),
|
||||
QLatin1String(receivedType));
|
||||
.arg(QLatin1StringView(receivedSignature),
|
||||
QLatin1StringView(expectedSignature),
|
||||
QLatin1StringView(data.typeName()),
|
||||
QLatin1StringView(receivedType));
|
||||
} else {
|
||||
errorMsg = "Unexpected reply signature: got \"%1\", expected \"%2\" (%3)"_L1
|
||||
.arg(QLatin1String(receivedSignature),
|
||||
QLatin1String(expectedSignature),
|
||||
QLatin1String(data.typeName()));
|
||||
.arg(QLatin1StringView(receivedSignature),
|
||||
QLatin1StringView(expectedSignature),
|
||||
QLatin1StringView(data.typeName()));
|
||||
}
|
||||
|
||||
error = QDBusError(QDBusError::InvalidSignature, errorMsg);
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ static bool variantToString(const QVariant &arg, QString &out)
|
|||
&& vUserType != QMetaType::fromType<QDBusSignature>()
|
||||
&& vUserType != QMetaType::fromType<QDBusObjectPath>()
|
||||
&& vUserType != QMetaType::fromType<QDBusArgument>())
|
||||
out += u'(' + QLatin1String(v.typeName()) + u')';
|
||||
out += u'(' + QLatin1StringView(v.typeName()) + u')';
|
||||
out += ": "_L1;
|
||||
if (!variantToString(v, out))
|
||||
return false;
|
||||
|
|
@ -154,7 +154,7 @@ static bool variantToString(const QVariant &arg, QString &out)
|
|||
out += u'\"' + arg.toString() + u'\"';
|
||||
} else {
|
||||
out += u'[';
|
||||
out += QLatin1String(arg.typeName());
|
||||
out += QLatin1StringView(arg.typeName());
|
||||
out += u']';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,11 +99,11 @@ namespace Q_DBUS_NO_EXPORT QDBusUtil
|
|||
{
|
||||
if (name.isEmpty()) {
|
||||
if (empty == EmptyAllowed) return true;
|
||||
*error = QDBusError(QDBusError::InvalidInterface, QLatin1String("Interface name cannot be empty"));
|
||||
*error = QDBusError(QDBusError::InvalidInterface, QLatin1StringView("Interface name cannot be empty"));
|
||||
return false;
|
||||
}
|
||||
if (isValidInterfaceName(name)) return true;
|
||||
*error = QDBusError(QDBusError::InvalidInterface, QLatin1String("Invalid interface class: %1").arg(name));
|
||||
*error = QDBusError(QDBusError::InvalidInterface, QLatin1StringView("Invalid interface class: %1").arg(name));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -111,11 +111,11 @@ namespace Q_DBUS_NO_EXPORT QDBusUtil
|
|||
{
|
||||
if (name.isEmpty()) {
|
||||
if (empty == EmptyAllowed) return true;
|
||||
*error = QDBusError(QDBusError::InvalidService, QLatin1String("Service name cannot be empty"));
|
||||
*error = QDBusError(QDBusError::InvalidService, QLatin1StringView("Service name cannot be empty"));
|
||||
return false;
|
||||
}
|
||||
if (isValidBusName(name)) return true;
|
||||
*error = QDBusError(QDBusError::InvalidService, QLatin1String("Invalid service name: %1").arg(name));
|
||||
*error = QDBusError(QDBusError::InvalidService, QLatin1StringView("Invalid service name: %1").arg(name));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -123,11 +123,11 @@ namespace Q_DBUS_NO_EXPORT QDBusUtil
|
|||
{
|
||||
if (path.isEmpty()) {
|
||||
if (empty == EmptyAllowed) return true;
|
||||
*error = QDBusError(QDBusError::InvalidObjectPath, QLatin1String("Object path cannot be empty"));
|
||||
*error = QDBusError(QDBusError::InvalidObjectPath, QLatin1StringView("Object path cannot be empty"));
|
||||
return false;
|
||||
}
|
||||
if (isValidObjectPath(path)) return true;
|
||||
*error = QDBusError(QDBusError::InvalidObjectPath, QLatin1String("Invalid object path: %1").arg(path));
|
||||
*error = QDBusError(QDBusError::InvalidObjectPath, QLatin1StringView("Invalid object path: %1").arg(path));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -136,12 +136,12 @@ namespace Q_DBUS_NO_EXPORT QDBusUtil
|
|||
if (!nameType) nameType = "member";
|
||||
if (name.isEmpty()) {
|
||||
if (empty == EmptyAllowed) return true;
|
||||
*error = QDBusError(QDBusError::InvalidMember, QLatin1String(nameType) + QLatin1String(" name cannot be empty"));
|
||||
*error = QDBusError(QDBusError::InvalidMember, QLatin1StringView(nameType) + QLatin1StringView(" name cannot be empty"));
|
||||
return false;
|
||||
}
|
||||
if (isValidMemberName(name)) return true;
|
||||
*error = QDBusError(QDBusError::InvalidMember, QLatin1String("Invalid %1 name: %2")
|
||||
.arg(QLatin1String(nameType), name));
|
||||
*error = QDBusError(QDBusError::InvalidMember, QLatin1StringView("Invalid %1 name: %2")
|
||||
.arg(QLatin1StringView(nameType), name));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -149,11 +149,11 @@ namespace Q_DBUS_NO_EXPORT QDBusUtil
|
|||
{
|
||||
if (name.isEmpty()) {
|
||||
if (empty == EmptyAllowed) return true;
|
||||
*error = QDBusError(QDBusError::InvalidInterface, QLatin1String("Error name cannot be empty"));
|
||||
*error = QDBusError(QDBusError::InvalidInterface, QLatin1StringView("Error name cannot be empty"));
|
||||
return false;
|
||||
}
|
||||
if (isValidErrorName(name)) return true;
|
||||
*error = QDBusError(QDBusError::InvalidInterface, QLatin1String("Invalid error name: %1").arg(name));
|
||||
*error = QDBusError(QDBusError::InvalidInterface, QLatin1StringView("Invalid error name: %1").arg(name));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ namespace Q_DBUS_NO_EXPORT QDBusUtil
|
|||
inline QString dbusInterface()
|
||||
{
|
||||
// it's the same string, but just be sure
|
||||
Q_ASSERT(dbusService() == QLatin1String(DBUS_INTERFACE_DBUS));
|
||||
Q_ASSERT(dbusService() == QLatin1StringView(DBUS_INTERFACE_DBUS));
|
||||
return dbusService();
|
||||
}
|
||||
inline QString dbusInterfaceProperties()
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ static inline QString typeNameToXml(const char *typeName)
|
|||
{
|
||||
// ### copied from qtextdocument.cpp
|
||||
// ### move this into Qt Core at some point
|
||||
const QLatin1String plain(typeName);
|
||||
const QLatin1StringView plain(typeName);
|
||||
QString rich;
|
||||
rich.reserve(int(plain.size() * 1.1));
|
||||
for (int i = 0; i < plain.size(); ++i) {
|
||||
|
|
@ -77,7 +77,7 @@ static inline QString typeNameToXml(const char *typeName)
|
|||
return rich;
|
||||
}
|
||||
|
||||
static inline QLatin1String accessAsString(bool read, bool write)
|
||||
static inline QLatin1StringView accessAsString(bool read, bool write)
|
||||
{
|
||||
if (read)
|
||||
return write ? "readwrite"_L1 : "read"_L1 ;
|
||||
|
|
@ -111,8 +111,8 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
|
|||
continue;
|
||||
|
||||
retval += " <property name=\"%1\" type=\"%2\" access=\"%3\""_L1
|
||||
.arg(QLatin1String(mp.name()),
|
||||
QLatin1String(signature),
|
||||
.arg(QLatin1StringView(mp.name()),
|
||||
QLatin1StringView(signature),
|
||||
accessAsString(mp.isReadable(), mp.isWritable()));
|
||||
|
||||
if (!QDBusMetaType::signatureToMetaType(signature).isValid()) {
|
||||
|
|
@ -204,7 +204,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
|
|||
|
||||
QString name;
|
||||
if (!names.at(j - 1).isEmpty())
|
||||
name = "name=\"%1\" "_L1.arg(QLatin1String(names.at(j - 1)));
|
||||
name = "name=\"%1\" "_L1.arg(QLatin1StringView(names.at(j - 1)));
|
||||
|
||||
bool isOutput = isSignal || j > inputCount;
|
||||
|
||||
|
|
@ -272,9 +272,9 @@ QString qDBusGenerateMetaObjectXml(QString interface, const QMetaObject *mo, con
|
|||
// generate the interface name from the meta object
|
||||
int idx = mo->indexOfClassInfo(QCLASSINFO_DBUS_INTERFACE);
|
||||
if (idx >= mo->classInfoOffset()) {
|
||||
interface = QLatin1String(mo->classInfo(idx).value());
|
||||
interface = QLatin1StringView(mo->classInfo(idx).value());
|
||||
} else {
|
||||
interface = QLatin1String(mo->className());
|
||||
interface = QLatin1StringView(mo->className());
|
||||
interface.replace("::"_L1, "."_L1);
|
||||
|
||||
if (interface.startsWith("QDBus"_L1)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue