diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-10-05 08:20:36 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-10 20:28:01 +0200 |
commit | 7f0d702f4e568790dfdfd916fa3c2da5ec78c6df (patch) | |
tree | 617646d5471b9da4126c33ff95e6670406bf62d7 /src/compositor/wayland_wrapper | |
parent | f047e8b9786df0fbee307a0ec425eea385ab6657 (diff) | |
download | qtwayland-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/compositor/wayland_wrapper')
-rw-r--r-- | src/compositor/wayland_wrapper/qwldatadevicemanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index b7d94ae9..04add014 100644 --- a/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -67,7 +67,7 @@ void DataDeviceManager::retain() { QList<QString> offers = m_current_selection_source->mimeTypes(); finishReadFromClient(); - if (m_retainedReadIndex >= offers.count()) { + if (m_retainedReadIndex >= offers.size()) { QWaylandCompositorPrivate::get(m_compositor)->feedRetainedSelectionData(&m_retainedData); return; } @@ -104,7 +104,7 @@ void DataDeviceManager::finishReadFromClient(bool exhausted) void DataDeviceManager::readFromClient(int fd) { static char buf[4096]; - int obsCount = m_obsoleteRetainedReadNotifiers.count(); + int obsCount = m_obsoleteRetainedReadNotifiers.size(); for (int i = 0; i < obsCount; ++i) { QSocketNotifier *sn = m_obsoleteRetainedReadNotifiers.at(i); if (sn->socket() == fd) { |