diff options
Diffstat (limited to 'src/tests/viewpropertiestest.cpp')
| -rw-r--r-- | src/tests/viewpropertiestest.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tests/viewpropertiestest.cpp b/src/tests/viewpropertiestest.cpp index a39abaef2..c4cc9cc41 100644 --- a/src/tests/viewpropertiestest.cpp +++ b/src/tests/viewpropertiestest.cpp @@ -31,6 +31,7 @@ private Q_SLOTS: void testExtendedAttributeFull(); void testUseAsDefaultViewSettings(); void testUseAsCustomDefaultViewSettings(); + void testSpecialFolderPropsPreservedWithGlobalViewProps(); private: bool m_globalViewProps; @@ -444,6 +445,33 @@ void ViewPropertiesTest::testUseAsCustomDefaultViewSettings() QCOMPARE(testDirProperties.data()->viewMode(), DolphinView::Mode::DetailsView); } +/** + * Test that special folders preserve user-customized view properties + * when global view props is enabled. Uses trash:/// as representative example. + */ +void ViewPropertiesTest::testSpecialFolderPropsPreservedWithGlobalViewProps() +{ + GeneralSettings::self()->setGlobalViewProps(true); + GeneralSettings::self()->save(); + + const QUrl trashUrl(QStringLiteral("trash:///")); + + // First visit: customize the view mode to IconsView + // (trash default is DetailsView) + { + ViewProperties props(trashUrl); + QCOMPARE(props.viewMode(), DolphinView::DetailsView); // default + props.setViewMode(DolphinView::IconsView); + props.save(); + } + + // Second visit: the custom view mode should be preserved + { + ViewProperties props(trashUrl); + QCOMPARE(props.viewMode(), DolphinView::IconsView); + } +} + QTEST_GUILESS_MAIN(ViewPropertiesTest) #include "viewpropertiestest.moc" |
