Try again to fix PlacesItemModelTest::testDefaultViewProperties()

Commit bff373d598 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.
This commit is contained in:
Elvis Angelaccio 2019-05-05 15:54:12 +02:00
parent 9f1b6eb3f4
commit 33a0d17ea8

View 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);