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>
This commit is contained in:
Marc Mutz 2022-10-05 08:20:36 +02:00
parent b32c8dd49e
commit 6c4ec81e6e
17 changed files with 64 additions and 64 deletions

View File

@ -610,7 +610,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin
void QWaylandDisplay::registry_global_remove(uint32_t id)
{
for (int i = 0, ie = mGlobals.count(); i != ie; ++i) {
for (int i = 0, ie = mGlobals.size(); i != ie; ++i) {
RegistryGlobal &global = mGlobals[i];
if (global.id == id) {
if (global.interface == QLatin1String(QtWayland::wl_output::interface()->name)) {
@ -677,7 +677,7 @@ void QWaylandDisplay::addRegistryListener(RegistryListener listener, void *data)
{
Listener l = { listener, data };
mRegistryListeners.append(l);
for (int i = 0, ie = mGlobals.count(); i != ie; ++i)
for (int i = 0, ie = mGlobals.size(); i != ie; ++i)
(*l.listener)(l.data, mGlobals[i].registry, mGlobals[i].id, mGlobals[i].interface, mGlobals[i].version);
}

View File

@ -148,7 +148,7 @@ QList<QPlatformScreen *> QWaylandScreen::virtualSiblings() const
const QList<QWaylandScreen*> screens = mWaylandDisplay->screens();
auto *placeholder = mWaylandDisplay->placeholderScreen();
list.reserve(screens.count() + (placeholder ? 1 : 0));
list.reserve(screens.size() + (placeholder ? 1 : 0));
for (QWaylandScreen *screen : qAsConst(screens)) {
if (screen->screen())

View File

@ -107,12 +107,12 @@ void QWaylandTouchExtension::touch_extension_touch(uint32_t time,
void QWaylandTouchExtension::sendTouchEvent()
{
// Copy all points, that are in the previous but not in the current list, as stationary.
for (int i = 0; i < mPrevTouchPoints.count(); ++i) {
for (int i = 0; i < mPrevTouchPoints.size(); ++i) {
const QWindowSystemInterface::TouchPoint &prevPoint(mPrevTouchPoints.at(i));
if (prevPoint.state == QEventPoint::Released)
continue;
bool found = false;
for (int j = 0; j < mTouchPoints.count(); ++j)
for (int j = 0; j < mTouchPoints.size(); ++j)
if (mTouchPoints.at(j).id == prevPoint.id) {
found = true;
break;
@ -132,14 +132,14 @@ void QWaylandTouchExtension::sendTouchEvent()
QWindowSystemInterface::handleTouchEvent(mTargetWindow, mTimestamp, mTouchDevice, mTouchPoints);
QEventPoint::States states = {};
for (int i = 0; i < mTouchPoints.count(); ++i)
for (int i = 0; i < mTouchPoints.size(); ++i)
states |= mTouchPoints.at(i).state;
if (mFlags & QT_TOUCH_EXTENSION_FLAGS_MOUSE_FROM_TOUCH) {
const bool firstPress = states == QEventPoint::Pressed;
if (firstPress)
mMouseSourceId = mTouchPoints.first().id;
for (int i = 0; i < mTouchPoints.count(); ++i) {
for (int i = 0; i < mTouchPoints.size(); ++i) {
const QWindowSystemInterface::TouchPoint &tp(mTouchPoints.at(i));
if (tp.id == mMouseSourceId) {
const bool released = tp.state == QEventPoint::Released;

View File

@ -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());
}

View File

@ -106,7 +106,7 @@ QInputMethodEvent *QWaylandInputMethodEventBuilder::buildCommit(const QString &t
const int absoluteOffset = absoluteCursor - cursor;
const int cursorAfterCommit = qMin(anchor, cursor) + replacement.first + text.length();
const int cursorAfterCommit = qMin(anchor, cursor) + replacement.first + text.size();
surrounding.replace(qMin(anchor, cursor) + replacement.first,
qAbs(anchor - cursor) + replacement.second, text);
@ -278,10 +278,10 @@ int QWaylandInputMethodEventBuilder::indexFromWayland(const QString &text, int l
if (length < 0) {
const QByteArray &utf8 = QStringView{text}.left(base).toUtf8();
return QString::fromUtf8(utf8.left(qMax(utf8.length() + length, 0))).length();
return QString::fromUtf8(utf8.left(qMax(utf8.size() + length, 0))).size();
} else {
const QByteArray &utf8 = QStringView{text}.mid(base).toUtf8();
return QString::fromUtf8(utf8.left(length)).length() + base;
return QString::fromUtf8(utf8.left(length)).size() + base;
}
}
@ -304,20 +304,20 @@ int QWaylandInputMethodEventBuilder::trimmedIndexFromWayland(const QString &text
const unsigned char ch = utf8.at(start + i);
// check if current character is a utf8's initial character.
if (ch < 0x80 || ch > 0xbf)
return QString::fromUtf8(utf8.left(start + i)).length();
return QString::fromUtf8(utf8.left(start + i)).size();
}
} else {
const QByteArray &utf8 = QStringView{text}.mid(base).toUtf8();
const int len = utf8.size();
const int start = length;
if (start >= len)
return base + QString::fromUtf8(utf8).length();
return base + QString::fromUtf8(utf8).size();
for (int i = 0; i < 4; i++) {
const unsigned char ch = utf8.at(start - i);
// check if current character is a utf8's initial character.
if (ch < 0x80 || ch > 0xbf)
return base + QString::fromUtf8(utf8.left(start - i)).length();
return base + QString::fromUtf8(utf8.left(start - i)).size();
}
}
return -1;

View File

@ -36,7 +36,7 @@ QByteArray QWaylandMimeHelper::getByteArray(QMimeData *mimeData, const QString &
content = qvariant_cast<QColor>(mimeData->colorData()).name().toLatin1();
} else if (mimeType == QLatin1String("text/uri-list")) {
QList<QUrl> urls = mimeData->urls();
for (int i = 0; i < urls.count(); ++i) {
for (int i = 0; i < urls.size(); ++i) {
content.append(urls.at(i).toEncoded());
content.append("\r\n");
}

View File

@ -590,7 +590,7 @@ void tst_WaylandClient::longWindowTitleWithUtf16Characters()
{
QWindow window;
QString absurdlyLongTitle = QString("").repeated(10000);
Q_ASSERT(absurdlyLongTitle.length() == 10000); // just making sure the test isn't broken
Q_ASSERT(absurdlyLongTitle.size() == 10000); // just making sure the test isn't broken
window.setTitle(absurdlyLongTitle);
window.show();
QCOMPOSITOR_TRY_VERIFY(surface());

View File

@ -69,10 +69,10 @@ void tst_clientextension::createWithoutGlobal()
QSignalSpy spy(&extension, &QWaylandClientExtension::activeChanged);
QVERIFY(spy.isValid());
QVERIFY(!extension.isActive());
QCOMPARE(spy.count(), 0);
QCOMPARE(spy.size(), 0);
extension.initialize();
QVERIFY(!extension.isActive());
QCOMPARE(spy.count(), 0);
QCOMPARE(spy.size(), 0);
}
void tst_clientextension::createWithGlobalAutomatic()
@ -83,7 +83,7 @@ void tst_clientextension::createWithGlobalAutomatic()
QSignalSpy spy(&extension, &QWaylandClientExtension::activeChanged);
QVERIFY(spy.isValid());
QTRY_VERIFY(extension.isActive());
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.size(), 1);
}
void tst_clientextension::createWithGlobalManual()
@ -96,7 +96,7 @@ void tst_clientextension::createWithGlobalManual()
QVERIFY(spy.isValid());
extension.initialize();
QVERIFY(extension.isActive());
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.size(), 1);
}
void tst_clientextension::globalBecomesAvailable()
@ -106,7 +106,7 @@ void tst_clientextension::globalBecomesAvailable()
QVERIFY(spy.isValid());
exec([this] { add<TestGlobal>(); });
QTRY_VERIFY(extension.isActive());
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.size(), 1);
}
void tst_clientextension::globalRemoved()
@ -120,7 +120,7 @@ void tst_clientextension::globalRemoved()
exec([this] { removeAll<TestGlobal>(); });
QTRY_VERIFY(!extension.isActive());
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.size(), 1);
}
QCOMPOSITOR_TEST_MAIN(tst_clientextension)

View File

@ -213,7 +213,7 @@ void tst_datadevicev1::destroysSelectionOnLeave()
keyboard()->sendLeave(surface);
});
QTRY_COMPARE(dataChangedSpy.count(), 1);
QTRY_COMPARE(dataChangedSpy.size(), 1);
QVERIFY(!QGuiApplication::clipboard()->mimeData(QClipboard::Clipboard)->hasText());
}

View File

@ -25,7 +25,7 @@ void tst_WaylandClientFullScreenShellV1::createDestroyWindow()
window.resize(800, 600);
window.show();
QCOMPOSITOR_TRY_VERIFY(fullScreenShellV1()->surfaces().count() == 1);
QCOMPOSITOR_TRY_VERIFY(fullScreenShellV1()->surfaces().size() == 1);
QCOMPOSITOR_VERIFY(surface(0));
window.destroy();

View File

@ -36,9 +36,9 @@ private:
{
exec([&] {
QList<arg_type *> extensions = getAll<arg_type>();
if (extensions.length() > 1)
if (extensions.size() > 1)
QFAIL("Requested type is a singleton, hence there should not be more then one object returned");
if (extensions.length() == 0)
if (extensions.size() == 0)
add<arg_type>();
});
}
@ -48,9 +48,9 @@ private:
{
exec([&] {
QList<arg_type *> extensions = getAll<arg_type>();
if (extensions.length() > 1)
if (extensions.size() > 1)
QFAIL("Requested type is a singleton, hence there should not be more then one object returned");
if (extensions.length() == 1)
if (extensions.size() == 1)
remove(extensions.first());
});
}

View File

@ -409,7 +409,7 @@ void tst_primaryselectionv1::destroysSelectionOnLeave()
keyboard()->sendLeave(surface);
});
QTRY_COMPARE(selectionChangedSpy.count(), 1);
QTRY_COMPARE(selectionChangedSpy.size(), 1);
QVERIFY(!QGuiApplication::clipboard()->mimeData(QClipboard::Selection)->hasText());
}

View File

@ -94,7 +94,7 @@ void tst_seat::usesEnterSerial()
});
QCOMPOSITOR_TRY_VERIFY(pointer()->cursorSurface());
QTRY_COMPARE(setCursorSpy.count(), 1);
QTRY_COMPARE(setCursorSpy.size(), 1);
QCOMPARE(setCursorSpy.takeFirst().at(0).toUInt(), enterSerial);
}
@ -438,14 +438,14 @@ void tst_seat::singleTap()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchBegin);
QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed);
QCOMPARE(e.touchPoints.length(), 1);
QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
}
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchEnd);
QCOMPARE(e.touchPointStates, QEventPoint::State::Released);
QCOMPARE(e.touchPoints.length(), 1);
QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
}
}
@ -469,14 +469,14 @@ void tst_seat::singleTapFloat()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchBegin);
QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed);
QCOMPARE(e.touchPoints.length(), 1);
QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints.first().position(), QPointF(32.75-window.frameMargins().left(), 32.25-window.frameMargins().top()));
}
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchEnd);
QCOMPARE(e.touchPointStates, QEventPoint::State::Released);
QCOMPARE(e.touchPoints.length(), 1);
QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints.first().position(), QPointF(32.75-window.frameMargins().left(), 32.25-window.frameMargins().top()));
}
}
@ -512,7 +512,7 @@ void tst_seat::multiTouch()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchBegin);
QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed);
QCOMPARE(e.touchPoints.length(), 2);
QCOMPARE(e.touchPoints.size(), 2);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Pressed);
QCOMPARE(e.touchPoints[0].position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
@ -523,7 +523,7 @@ void tst_seat::multiTouch()
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchUpdate);
QCOMPARE(e.touchPoints.length(), 2);
QCOMPARE(e.touchPoints.size(), 2);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Updated);
QCOMPARE(e.touchPoints[0].position(), QPointF(33-window.frameMargins().left(), 32-window.frameMargins().top()));
@ -535,7 +535,7 @@ void tst_seat::multiTouch()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchUpdate);
QCOMPARE(e.touchPointStates, QEventPoint::State::Released | QEventPoint::State::Stationary);
QCOMPARE(e.touchPoints.length(), 2);
QCOMPARE(e.touchPoints.size(), 2);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released);
QCOMPARE(e.touchPoints[0].position(), QPointF(33-window.frameMargins().left(), 32-window.frameMargins().top()));
@ -547,7 +547,7 @@ void tst_seat::multiTouch()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchEnd);
QCOMPARE(e.touchPointStates, QEventPoint::State::Released);
QCOMPARE(e.touchPoints.length(), 1);
QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released);
QCOMPARE(e.touchPoints[0].position(), QPointF(49-window.frameMargins().left(), 48-window.frameMargins().top()));
}
@ -589,14 +589,14 @@ void tst_seat::multiTouchUpAndMotionFrame()
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchUpdate);
QCOMPARE(e.touchPoints.length(), 2);
QCOMPARE(e.touchPoints.size(), 2);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released);
QCOMPARE(e.touchPoints[1].state(), QEventPoint::State::Updated);
}
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchEnd);
QCOMPARE(e.touchPoints.length(), 1);
QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints[0].state(), QEventPoint::State::Released);
}
QVERIFY(window.m_events.empty());
@ -653,13 +653,13 @@ void tst_seat::cancelTouch()
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchBegin);
QCOMPARE(e.touchPointStates, QEventPoint::State::Pressed);
QCOMPARE(e.touchPoints.length(), 1);
QCOMPARE(e.touchPoints.size(), 1);
QCOMPARE(e.touchPoints.first().position(), QPointF(32-window.frameMargins().left(), 32-window.frameMargins().top()));
}
{
auto e = window.m_events.takeFirst();
QCOMPARE(e.type, QEvent::TouchCancel);
QCOMPARE(e.touchPoints.length(), 0);
QCOMPARE(e.touchPoints.size(), 0);
}
}

View File

@ -127,7 +127,7 @@ void tst_seatv4::usesEnterSerial()
});
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
QTRY_COMPARE(setCursorSpy.count(), 1);
QTRY_COMPARE(setCursorSpy.size(), 1);
QCOMPARE(setCursorSpy.takeFirst().at(0).toUInt(), enterSerial);
}
@ -139,13 +139,13 @@ void tst_seatv4::focusDestruction()
window.show();
QCOMPOSITOR_TRY_VERIFY(xdgSurface() && xdgSurface()->m_committedConfigureSerial);
// Setting a cursor now is not allowed since there has been no enter event
QCOMPARE(setCursorSpy.count(), 0);
QCOMPARE(setCursorSpy.size(), 0);
uint enterSerial = exec([&] {
return pointer()->sendEnter(xdgSurface()->m_surface, {32, 32});
});
QCOMPOSITOR_TRY_VERIFY(cursorSurface());
QTRY_COMPARE(setCursorSpy.count(), 1);
QTRY_COMPARE(setCursorSpy.size(), 1);
QCOMPARE(setCursorSpy.takeFirst().at(0).toUInt(), enterSerial);
// Destroy the focus
@ -159,7 +159,7 @@ void tst_seatv4::focusDestruction()
// Setting a cursor now is not allowed since there has been no enter event
xdgPingAndWaitForPong();
QCOMPARE(setCursorSpy.count(), 0);
QCOMPARE(setCursorSpy.size(), 0);
}
void tst_seatv4::mousePress()
@ -568,7 +568,7 @@ void tst_seatv4::animatedCursor()
});
// Verify that we get a new cursor buffer
QTRY_COMPARE(bufferSpy.count(), 1);
QTRY_COMPARE(bufferSpy.size(), 1);
}
#endif // QT_CONFIG(cursor)

View File

@ -92,7 +92,7 @@ void DefaultCompositor::xdgPingAndWaitForPong()
{
QSignalSpy pongSpy(exec([=] { return get<XdgWmBase>(); }), &XdgWmBase::pong);
uint serial = exec([=] { return sendXdgShellPing(); });
QTRY_COMPARE(pongSpy.count(), 1);
QTRY_COMPARE(pongSpy.size(), 1);
QTRY_COMPARE(pongSpy.first().at(0).toUInt(), serial);
}

View File

@ -55,7 +55,7 @@ void tst_surface::waitForFrameCallbackRaster()
exec([=] { xdgToplevel()->sendCompleteConfigure(); });
// We should get the first buffer without waiting for a frame callback
QTRY_COMPARE(bufferSpy.count(), 1);
QTRY_COMPARE(bufferSpy.size(), 1);
bufferSpy.removeFirst();
// Make sure we follow frame callbacks for some frames
@ -66,7 +66,7 @@ void tst_surface::waitForFrameCallbackRaster()
QVERIFY(!xdgToplevel()->surface()->m_waitingFrameCallbacks.empty());
xdgToplevel()->surface()->sendFrameCallbacks();
});
QTRY_COMPARE(bufferSpy.count(), 1);
QTRY_COMPARE(bufferSpy.size(), 1);
bufferSpy.removeFirst();
}
}
@ -96,14 +96,14 @@ void tst_surface::waitForFrameCallbackGl()
exec([=] { xdgToplevel()->sendCompleteConfigure(); });
// We should get the first buffer without waiting for a frame callback
QTRY_COMPARE(bufferSpy.count(), 1);
QTRY_COMPARE(bufferSpy.size(), 1);
bufferSpy.removeFirst();
// Make sure we follow frame callbacks for some frames
for (int i = 0; i < 5; ++i) {
xdgPingAndWaitForPong(); // Make sure things have happened on the client
if (!qEnvironmentVariableIntValue("QT_WAYLAND_DISABLE_WINDOWDECORATION") && i == 0) {
QCOMPARE(bufferSpy.count(), 1);
QCOMPARE(bufferSpy.size(), 1);
bufferSpy.removeFirst();
}
exec([&] {
@ -111,7 +111,7 @@ void tst_surface::waitForFrameCallbackGl()
QVERIFY(!xdgToplevel()->surface()->m_waitingFrameCallbacks.empty());
xdgToplevel()->surface()->sendFrameCallbacks();
});
QTRY_COMPARE(bufferSpy.count(), 1);
QTRY_COMPARE(bufferSpy.size(), 1);
bufferSpy.removeFirst();
}
}
@ -168,15 +168,15 @@ void tst_surface::createSubsurface()
// Move subsurface. The parent should redraw and commit
subWindow.setGeometry(100, 100, 64, 64);
// the toplevel should commit to indicate the subsurface moved
QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.count(), 1);
QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.size(), 1);
mainSurfaceCommitSpy.clear();
childSurfaceCommitSpy.clear();
// Move and resize the subSurface. The parent should redraw and commit
// The child should also redraw
subWindow.setGeometry(50, 50, 80, 80);
QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.count(), 1);
QCOMPOSITOR_TRY_COMPARE(childSurfaceCommitSpy.count(), 1);
QCOMPOSITOR_TRY_COMPARE(mainSurfaceCommitSpy.size(), 1);
QCOMPOSITOR_TRY_COMPARE(childSurfaceCommitSpy.size(), 1);
}

View File

@ -78,7 +78,7 @@ void tst_xdgshell::basicConfigure()
QTRY_VERIFY(window.isExposed());
// The client is now going to ack the configure
QTRY_COMPARE(configureSpy.count(), 1);
QTRY_COMPARE(configureSpy.size(), 1);
QCOMPARE(configureSpy.takeFirst().at(0).toUInt(), serial);
// And attach a buffer
@ -104,7 +104,7 @@ void tst_xdgshell::configureSize()
xdgToplevel()->sendCompleteConfigure(configureSize);
});
QTRY_COMPARE(configureSpy.count(), 1);
QTRY_COMPARE(configureSpy.size(), 1);
exec([=] {
Buffer *buffer = xdgToplevel()->surface()->m_committed.buffer;
@ -192,7 +192,7 @@ void tst_xdgshell::popup()
QCOMPOSITOR_TRY_VERIFY(xdgToplevel());
QSignalSpy toplevelConfigureSpy(exec([=] { return xdgSurface(); }), &XdgSurface::configureCommitted);
exec([=] { xdgToplevel()->sendCompleteConfigure(); });
QTRY_COMPARE(toplevelConfigureSpy.count(), 1);
QTRY_COMPARE(toplevelConfigureSpy.size(), 1);
uint clickSerial = exec([=] {
auto *surface = xdgToplevel()->surface();
@ -230,7 +230,7 @@ void tst_xdgshell::popup()
QTRY_VERIFY(popup->isExposed());
// The client is now going to ack the configure
QTRY_COMPARE(popupConfigureSpy.count(), 1);
QTRY_COMPARE(popupConfigureSpy.size(), 1);
QCOMPARE(popupConfigureSpy.takeFirst().at(0).toUInt(), configureSerial);
// And attach a buffer
@ -560,7 +560,7 @@ void tst_xdgshell::pongs()
wl_resource *resource = base->resourceMap().first()->handle;
base->send_ping(resource, serial);
});
QTRY_COMPARE(pongSpy.count(), 1);
QTRY_COMPARE(pongSpy.size(), 1);
QCOMPARE(pongSpy.first().at(0).toUInt(), serial);
}
@ -626,7 +626,7 @@ void tst_xdgshell::foreignSurface()
// the pointer events above are handled.
QSignalSpy spy(exec([=] { return surface(newSurfaceIndex); }), &Surface::commit);
wl_surface_commit(foreignSurface);
QTRY_COMPARE(spy.count(), 1);
QTRY_COMPARE(spy.size(), 1);
wl_surface_destroy(foreignSurface);
}