]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Use directly "isEmpty()"
authorLaurent Montel <montel@kde.org>
Sat, 14 Sep 2019 07:40:09 +0000 (09:40 +0200)
committerLaurent Montel <montel@kde.org>
Sat, 14 Sep 2019 07:40:09 +0000 (09:40 +0200)
src/dolphinmainwindow.cpp
src/tests/kfileitemmodeltest.cpp
src/tests/kitemsettest.cpp

index ec42d33f71adc50ad699ce7300b8e24c4f91cb00..32ac0e0fdcc234537bb0d1da4f4a9612b76593ba 100644 (file)
@@ -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 {
index c539799707ae1b8870f5f19c15f436399b858d49..f081eba86032f57e3a6a8d7f8b9919df7445f7c9 100644 (file)
@@ -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());
         }
 
index 27f8413a75b273700f44ff7833f4049e752b8aa4..ca2c16b27ba2070ada88efcbbc59e6e0c698431d 100644 (file)
@@ -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;