aboutsummaryrefslogtreecommitdiffstats
path: root/src/webchannel
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-10-05 08:21:25 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-10-07 17:15:50 +0200
commit290e04469a3d8e19c0a7017138ae7d4e812615e1 (patch)
treec49ad30f842563ad659ebf8272fcbcebb4b92be1 /src/webchannel
parent0cc735971ac07e93525690efb778c6bd7c3bcbd2 (diff)
Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: I34d5ddf6742eda92ae291d2fd0ced98fcee92b7b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/webchannel')
-rw-r--r--src/webchannel/qmetaobjectpublisher.cpp4
-rw-r--r--src/webchannel/signalhandler_p.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/webchannel/qmetaobjectpublisher.cpp b/src/webchannel/qmetaobjectpublisher.cpp
index e27d620..b1fed71 100644
--- a/src/webchannel/qmetaobjectpublisher.cpp
+++ b/src/webchannel/qmetaobjectpublisher.cpp
@@ -152,7 +152,7 @@ QMetaType resultTypeOfQFuture(QByteArrayView typeName)
if (!typeName.startsWith("QFuture<") || !typeName.endsWith('>'))
return {};
- return QMetaType::fromName(typeName.sliced(8, typeName.length() - 9));
+ return QMetaType::fromName(typeName.sliced(8, typeName.size() - 9));
}
template<typename Func>
@@ -302,7 +302,7 @@ QJsonObject QMetaObjectPublisher::classInfoForObject(const QObject *object, QWeb
// optimize: compress the common propertyChanged notification names, just send a 1
const QByteArray &notifySignal = prop.notifySignal().name();
static const QByteArray changedSuffix = QByteArrayLiteral("Changed");
- if (notifySignal.length() == changedSuffix.length() + propertyName.length() &&
+ if (notifySignal.size() == changedSuffix.size() + propertyName.size() &&
notifySignal.endsWith(changedSuffix) && notifySignal.startsWith(prop.name()))
{
signalInfo.append(1);
diff --git a/src/webchannel/signalhandler_p.h b/src/webchannel/signalhandler_p.h
index 876413d..f5a378a 100644
--- a/src/webchannel/signalhandler_p.h
+++ b/src/webchannel/signalhandler_p.h
@@ -195,9 +195,9 @@ void SignalHandler<Receiver>::dispatch(const QObject *object, const int signalId
}
const QList<int> &argumentTypes = *signalIt;
QVariantList arguments;
- arguments.reserve(argumentTypes.count());
+ arguments.reserve(argumentTypes.size());
// TODO: basic overload resolution based on number of arguments?
- for (int i = 0; i < argumentTypes.count(); ++i) {
+ for (int i = 0; i < argumentTypes.size(); ++i) {
const QMetaType::Type type = static_cast<QMetaType::Type>(argumentTypes.at(i));
QVariant arg;
if (type == QMetaType::QVariant) {