summaryrefslogtreecommitdiff
path: root/src/client/qwaylandwindow.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-10-05 08:20:36 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-10-10 20:28:01 +0200
commit7f0d702f4e568790dfdfd916fa3c2da5ec78c6df (patch)
tree617646d5471b9da4126c33ff95e6670406bf62d7 /src/client/qwaylandwindow.cpp
parentf047e8b9786df0fbee307a0ec425eea385ab6657 (diff)
downloadqtwayland-7f0d702f4e568790dfdfd916fa3c2da5ec78c6df.tar.gz
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: I574208abc90a8042b500b3f96e3862b0ff339eb6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r--src/client/qwaylandwindow.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 001f99d0..73a14b89 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -132,7 +132,7 @@ void QWaylandWindow::initWindow()
mShellSurface->setAppId(fi.baseName());
} else {
QString appId;
- for (int i = 0; i < domainName.count(); ++i)
+ for (int i = 0; i < domainName.size(); ++i)
appId.prepend(QLatin1Char('.')).prepend(domainName.at(i));
appId.append(fi.baseName());
mShellSurface->setAppId(appId);
@@ -288,9 +288,9 @@ void QWaylandWindow::setWindowTitle(const QString &title)
const int maxLength = libwaylandMaxBufferSize / 3 - 100;
auto truncated = QStringView{formatted}.left(maxLength);
- if (truncated.length() < formatted.length()) {
+ if (truncated.size() < formatted.size()) {
qCWarning(lcQpaWayland) << "Window titles longer than" << maxLength << "characters are not supported."
- << "Truncating window title (from" << formatted.length() << "chars)";
+ << "Truncating window title (from" << formatted.size() << "chars)";
}
mShellSurface->setTitle(truncated.toString());
}