From 33a0d17ea8d4de81322ca51a5acc1356f37798ed Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sun, 5 May 2019 15:54:12 +0200 Subject: 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. --- src/tests/placesitemmodeltest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.3