]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix PlacesItemModelTest::testDefaultViewProperties()
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Wed, 20 Mar 2019 20:34:37 +0000 (21:34 +0100)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Wed, 20 Mar 2019 20:36:31 +0000 (21:36 +0100)
The test was assuming that global view properties are off by default,
which is no longer true after d6c086ad04.

src/tests/placesitemmodeltest.cpp

index 40ee47cbc9beb514eb71a0cb327cc67e3da6feed..fac0931a6c31a56b6a6beac397a2e1c9b7935950 100644 (file)
@@ -29,6 +29,7 @@
 #include <KAboutData>
 #include <KFilePlacesModel>
 
+#include "dolphin_generalsettings.h"
 #include "panels/places/placesitemmodel.h"
 #include "panels/places/placesitem.h"
 #include "views/viewproperties.h"
@@ -475,10 +476,18 @@ void PlacesItemModelTest::testDefaultViewProperties()
     QFETCH(bool, expectedPreviewShow);
     QFETCH(QList<QByteArray>, expectedVisibleRole);
 
+    // In order to test the default view properties, turn off the global view properties.
+    GeneralSettings* settings = GeneralSettings::self();
+    settings->setGlobalViewProps(false);
+    settings->save();
+
     ViewProperties properties(KFilePlacesModel::convertedUrl(url));
     QCOMPARE(properties.viewMode(), expectedViewMode);
     QCOMPARE(properties.previewsShown(), expectedPreviewShow);
     QCOMPARE(properties.visibleRoles(), expectedVisibleRole);
+
+    settings->setGlobalViewProps(true);
+    settings->save();
 }
 
 void PlacesItemModelTest::testClear()