]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/kitemlistcontrollertest.cpp
Fix building kfileitemmodeltest with KF6
[dolphin.git] / src / tests / kitemlistcontrollertest.cpp
index 7bc6b5d99d4f90d4ef4517f549250a8b7b71f0aa..4149a4d85c1b4d7fbc794b120c9731d6e7045a26 100644 (file)
@@ -16,6 +16,7 @@
 #include <QGraphicsSceneMouseEvent>
 #include <QSignalSpy>
 #include <QProxyStyle>
+#include <QStandardPaths>
 
 /**
  * \class KItemListControllerTestStyle is a proxy style for testing the
@@ -68,7 +69,7 @@ class KItemListControllerTest : public QObject
 {
     Q_OBJECT
 
-private slots:
+private Q_SLOTS:
     void initTestCase();
     void cleanupTestCase();
 
@@ -103,6 +104,7 @@ private:
  */
 void KItemListControllerTest::initTestCase()
 {
+    QStandardPaths::setTestModeEnabled(true);
     qRegisterMetaType<KItemSet>("KItemSet");
 
     m_testDir = new TestDir();
@@ -241,7 +243,7 @@ void KItemListControllerTest::testKeyboardNavigation_data()
     groupingEnabledList.append(true);
     groupingEnabledNames[true] = "grouping enabled";
 
-    foreach (const KFileItemListView::ItemLayout& layout, layoutList) {
+    for (const KFileItemListView::ItemLayout& layout : layoutList) {
         // The following settings depend on the layout.
         // Note that 'columns' are actually 'rows' in
         // Compact layout.
@@ -279,9 +281,9 @@ void KItemListControllerTest::testKeyboardNavigation_data()
             break;
         }
 
-        foreach (int columnCount, columnCountList) {
-            foreach (const KItemListController::SelectionBehavior& selectionBehavior, selectionBehaviorList) {
-                foreach (bool groupingEnabled, groupingEnabledList) { // krazy:exclude=foreach
+        for (int columnCount : qAsConst(columnCountList)) {
+            for (const KItemListController::SelectionBehavior& selectionBehavior : qAsConst(selectionBehaviorList)) {
+                for (bool groupingEnabled : qAsConst(groupingEnabledList)) {
                     QList<QPair<KeyPress, ViewState> > testList;
 
                     // First, key presses which should have the same effect