]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Try again to fix PlacesItemModelTest::testDefaultViewProperties()
authorElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 5 May 2019 13:54:12 +0000 (15:54 +0200)
committerElvis Angelaccio <elvis.angelaccio@kde.org>
Sun, 5 May 2019 13:54:12 +0000 (15:54 +0200)
Commit bff373d598c031cb1 was not enough because the model takes into
account the global view properties setting (in PlacesItemModel::initializeDefaultViewProperties()).

This means we need to disable the setting before init() runs.

src/tests/placesitemmodeltest.cpp

index fac0931a6c31a56b6a6beac397a2e1c9b7935950..4ed4945b2010e3bcdef5ced73623ff81364769c7 100644 (file)
@@ -476,10 +476,12 @@ void PlacesItemModelTest::testDefaultViewProperties()
     QFETCH(bool, expectedPreviewShow);
     QFETCH(QList<QByteArray>, expectedVisibleRole);
 
-    // In order to test the default view properties, turn off the global view properties.
+    // 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);