]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/tests/placesitemmodeltest.cpp
Merge branch 'Applications/19.04'
[dolphin.git] / src / tests / placesitemmodeltest.cpp
index 40ee47cbc9beb514eb71a0cb327cc67e3da6feed..4ed4945b2010e3bcdef5ced73623ff81364769c7 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,20 @@ void PlacesItemModelTest::testDefaultViewProperties()
     QFETCH(bool, expectedPreviewShow);
     QFETCH(QList<QByteArray>, expectedVisibleRole);
 
+    // In order to test the default view properties, turn off the global view properties and re-init the test to reload the model.
+    GeneralSettings* settings = GeneralSettings::self();
+    settings->setGlobalViewProps(false);
+    settings->save();
+    cleanup();
+    init();
+
     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()