From: Elvis Angelaccio Date: Sun, 5 May 2019 13:54:12 +0000 (+0200) Subject: Try again to fix PlacesItemModelTest::testDefaultViewProperties() X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/33a0d17ea8d4de81322ca51a5acc1356f37798ed Try again to fix PlacesItemModelTest::testDefaultViewProperties() 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. --- diff --git a/src/tests/placesitemmodeltest.cpp b/src/tests/placesitemmodeltest.cpp index fac0931a6..4ed4945b2 100644 --- a/src/tests/placesitemmodeltest.cpp +++ b/src/tests/placesitemmodeltest.cpp @@ -476,10 +476,12 @@ void PlacesItemModelTest::testDefaultViewProperties() QFETCH(bool, expectedPreviewShow); QFETCH(QList, 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);