diff options
| author | Méven Car <[email protected]> | 2026-05-03 14:53:01 +0200 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2026-06-13 12:24:37 +0200 |
| commit | 70f34211cb4ad1f3f6170ded062bafff85d66643 (patch) | |
| tree | cdcbce9a16cc6deed31f0550e7867b0335968ea2 /src/tests/viewpropertiestest.cpp | |
| parent | 169332e5691267fd69ac20ac2b1aa06441c588db (diff) | |
Add A restore view properties to defaults button
The button allows to restore to defaults, in case you are using the
per-folder view properties settings.
The button disables or enables itself whether or not it matches the
defaults view settings.
Diffstat (limited to 'src/tests/viewpropertiestest.cpp')
| -rw-r--r-- | src/tests/viewpropertiestest.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/tests/viewpropertiestest.cpp b/src/tests/viewpropertiestest.cpp index 101fff707..f90d57b88 100644 --- a/src/tests/viewpropertiestest.cpp +++ b/src/tests/viewpropertiestest.cpp @@ -38,6 +38,7 @@ private Q_SLOTS: void testUseAsDefaultViewSettings(); void testUseAsCustomDefaultViewSettings(); void testSpecialFolderPropsPreservedWithGlobalViewProps(); + void testRestoreViewProps(); private: bool m_globalViewProps; @@ -579,6 +580,29 @@ void ViewPropertiesTest::testSpecialFolderPropsPreservedWithGlobalViewProps() } } +void ViewPropertiesTest::testRestoreViewProps() +{ + const QUrl testDirUrl = m_testDir->url(); + + // First visit: customize the view mode to DetailsView + { + ViewProperties props(testDirUrl); + QCOMPARE(props.viewMode(), DolphinView::IconsView); // default + props.setViewMode(DolphinView::DetailsView); + } + { + ViewProperties props(testDirUrl); + QCOMPARE(props.viewMode(), DolphinView::DetailsView); + QVERIFY(!props.isDefaults()); + } + { + ViewProperties props(testDirUrl); + props.restoreToDefaults(); + QVERIFY(props.isDefaults()); + QCOMPARE(props.viewMode(), DolphinView::IconsView); + } +} + QTEST_GUILESS_MAIN(ViewPropertiesTest) #include "viewpropertiestest.moc" |
