From da83e8cbdb0354f359bdf08d610693665989c9f1 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Sat, 14 Sep 2019 09:40:09 +0200 Subject: [PATCH] Use directly "isEmpty()" --- src/dolphinmainwindow.cpp | 2 +- src/tests/kfileitemmodeltest.cpp | 2 +- src/tests/kitemsettest.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index ec42d33f7..32ac0e0fd 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -359,7 +359,7 @@ void DolphinMainWindow::addToPlaces() QString name; // If nothing is selected, act on the current dir - if (m_activeViewContainer->view()->selectedItems().count() == 0) { + if (m_activeViewContainer->view()->selectedItems().isEmpty()) { url = m_activeViewContainer->url(); name = m_activeViewContainer->placesText(); } else { diff --git a/src/tests/kfileitemmodeltest.cpp b/src/tests/kfileitemmodeltest.cpp index c53979970..f081eba86 100644 --- a/src/tests/kfileitemmodeltest.cpp +++ b/src/tests/kfileitemmodeltest.cpp @@ -460,7 +460,7 @@ void KFileItemModelTest::testModelConsistencyWhenInsertingItems() } m_model->m_dirLister->updateDirectory(m_testDir->url()); - if (itemsInsertedSpy.count() == 0) { + if (itemsInsertedSpy.isEmpty()) { QVERIFY(itemsInsertedSpy.wait()); } diff --git a/src/tests/kitemsettest.cpp b/src/tests/kitemsettest.cpp index 27f8413a7..ca2c16b27 100644 --- a/src/tests/kitemsettest.cpp +++ b/src/tests/kitemsettest.cpp @@ -203,7 +203,7 @@ void KItemSetTest::testIterators() QVERIFY(itemSet.isValid()); QVERIFY(itemSet.count() == itemsQVector.count()); - if (itemSet.count() == 0) { + if (itemSet.isEmpty()) { QVERIFY(itemSet.isEmpty()); QVERIFY(itemSet.begin() == itemSet.end()); QVERIFY(itemSet.constBegin() == itemSet.constEnd()); @@ -342,7 +342,7 @@ void KItemSetTest::testFind() int min; int max; - if (itemSet.count() == 0) { + if (itemSet.isEmpty()) { // Use some arbitrary values for the upcoming tests. min = 0; max = 5; @@ -401,7 +401,7 @@ void KItemSetTest::testChangingOneItem() int min; int max; - if (itemSet.count() == 0) { + if (itemSet.isEmpty()) { // Use some arbitrary values for the upcoming tests. min = 0; max = 5;