┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests
AgeCommit message (Collapse)Author
2024-10-27ViewProperties: Store view properties in extended file attributesMéven Car
Existing settings are converted. Works on most FS except FAT/exFAT which fallback to .directory files. If the extended file attributes (in ADS in Windows) can't be saved, they are saved to file as before. BUG: 322922 You can see file xattr using for instance for Unix filesystems: getfattr -d /home/meven
2024-10-17Add test to avoid accidental divergence of desktop and phone uiFelix Ernst
The dolphinui.rc and dolphinuiforphones.rc file describe parts of the desktop and phone user interfaces for Dolphin. They are meant to be different in specific ways, but identical in many others. This test makes sure that the two ui files stay mostly identical by requiring any differences between them need to be explicitly stated/registered as an exception in the test. This way no accidental divergence of user interfaces can happen.
2024-08-18Implement "Focus Places Panel"Felix Ernst
This commit implements an action to move focus to the Places panel analogous to "Focus Terminal Panel" functionality-wise. The implementation of the "Focus Terminal Panel" and "Focus Places Panel" actions is streamlined while improving their code quality. The "Focus Terminal Panel" action is moved into the "Show Panels" sub-menu because it makes more sense to be there considering that its previous location (the "Tools" menu) is meant for external applications and not for functionality internal to Dolphin. This commit also makes it so the keyboard focus is moved to and from the Places panel whenever it is toggled visible or invisible. This is now consistent with the focus handling when the Terminal panel is shown or hidden. The "Focus Places Panel" is one of the actions which was wished for in KDE's accessibility chat room because people relying on keyboard controls might need to press the Tab key a lot to move from the view to the Places panel. The new default shortcut is Ctrl+P.
2024-07-31Kitemlistcontroller: only accept doubleclick for left mouse buttonMéven Car
Add test for double-click activation. BUG: 485295
2024-05-18Avoid implicitly selecting itemsFelix Ernst
Items should only be selected if the user wants to act on them. However, previous to this commit we sometimes selected items even when there is no reason to assume that the user would like to act on them. Such selections are dangerous because they make it more likely that the user manipulates items by accident which they never even explicitly selected. Example: The "Up" action is used to navigate to the parent folder. This will implicitly select the folder one emerged from after opening the parent folder, so just one accidental press of the Delete key will lead to data loss if the press goes unnoticed. This scenario would have been avoided if no folder had been selected automatically. The above example becomes even more dangerous if the user is acting with elevated privileges. The following implicit selections of items are being removed: - Selecting items that are being activated - Selecting folders one emerges from Even though these items will no longer be selected after these actions, they will still be marked as current. The only downside I see is that our indication of which item is "current" is a lot weaker than the selection highlight, so it might be more difficult to spot which folder one has emerged from. However, this could be counter-acted with some other temporary indication if this really turns out to be a problem. The only downside I see is that our indication of which item is "current" is a lot weaker than the selection highlight, so it might be more difficult to spot which folder one has emerged from. However, this could be counter-acted with some other temporary indication if this really turns out to be a problem. BUG: 424723
2024-03-27Better support for RTLEugene Popov
This MR fixes some issues related to RTL scripts: - wrong layout in Compact View mode - broken horizontal scrolling in Icon View and Details View modes - broken navigation with left and right arrow keys in Details View mode BUG: 484012 BUG: 449493
2024-03-14Adapt testOpenInNewTabTitle() to upstream changeFelix Ernst
Prior to this commit the test failed because it expected a generic "inode-directory" icon for directories like "home" or "tmp" even though we have more specialised and nicer icons for these directories. I assume the test only used to pass because we were actually always using generic and therefore unhelpful icons for tabs. This commit removes the hard-coded expectation of the "inode-directory" icon and instead compares the tab icon with the return value of KIO::iconNameForUrl(tabUrl).
2024-03-13Animate most of the barsFelix Ernst
When a bar is toggled visible this usually happens because the user might want to use its functionality now. However, if bars appear without animation or at a location the user is not currently looking at, they might not notice that they have appeared at all. An animation makes it more likely that the user notices the change and can then use the newly made visible component. Another reason for animations for showing or hiding of components is that it can be disorienting for users when panels or bars suddenly appear or disappear without animation. There is no visible movement then, so the user might not know what happened if they didn't concentrate or blink at that moment. The newly appearing or disappearing component might also displace other components which can make it difficult to find what one was just looking at. These bars animate now after this change: - Search panel - Filter bar - Status bar This is implemented by extracting the animation code from SelectionMode::TopBar into a new abstract base class AnimatedHeightWidget. This class is now also used in SelectionMode::BottomBar and the animating code there was removed. These bars are left in Dolphin that stay without animation: - Menu bar (Would probably need to be implemented in KXmlGui) - Tool bar (Would probably need to be implemented in KXmlGui) - Tab bar (Needs a different appraoch because it already inherits QTabBar and therefore can not inherit AnimatedHeightWidget)
2024-02-01Fix focus chainFelix Ernst
Prior to this commit pressing Tab repeatedly would bring the focus to the end of the status bar but not further. This commit makes sure the tab focus doesn't get stuck on the invisible tab bar by explicitly removing the DolphinTabBar from the focus chain while it is hidden. I don't understand why pressing Tab doesn't do anything for the invisible tab bar, but removing an invisible and currently useless widget from the focus chain seems sensible in any case. Improve the accessibility autotest to prevent regressions concerning this.
2024-02-01Speed up autoSaveSession testFelix Ernst
Normally, the session is only saved after a few seconds. The autotest waits for that to happen. This commit reduces the time until the session is saved to a fraction of a seconds which means that the autotest will complete faster.
2024-01-30Add test cases for right-to-left keyboard navigationFelix Ernst
This commit reuses our test cases for keyboard navigation to also test the right-to-left layout direction under various conditions. There is also a small change to make the error output more human-readable.
2024-01-14DolphinMainWindowTest: Add unit test for autosave session featureAmol Godbole
Adds a simple test to check if session is autosaved when a new tab is opened.
2023-12-27Fix build with cmake >= 3.28Albert Astals Cid
Proposed by krop on #kde-devel Unless my bisect skills failed broken by https://gitlab.kitware.com/cmake/cmake/-/commit/ebc9e448b38378cc21a6b77df03a77d9732c24ac
2023-12-27kfileitemmodeltest: Include KIO/SimpleJob header instead of relying on ↵Alexander Lohnau
compat code Amends 3f92ac800c5e52d0a5622367ff8ffe8cbbdfa184
2023-12-15Resort directory size count after refreshingAkseli Lahtinen
After refreshing the view when size count is selected as the sortRole, count is 0 at first. When the actual count is loaded, the sorting is done according to the count being 0. This can break the sort order and cause view and model to be out of sync. Making sure we always resort all items when the directory size/item count is changed fixes this BUG:473999
2023-11-08Master is qt6 only. Not necessary to use ${QT_MAJOR_VERSION} now.Laurent Montel
Remove qt5 specific cmake code too
2023-10-05Merge branch 'master' into kf6Nate Graham
2023-10-05Add test for accessibility ancestor treeFelix Ernst
This is to make sure that all items that can be tabbed to and their accessible children have the main window somewhere in their ancestry/ancestor tree.
2023-10-05Fix accessibility ancestor treeFelix Ernst
Before this commit, KItemListViewAccessible would always return nullptr as its parent. This meant that accessibility software would have to guess to which window/hierarchy the KItemListView belongs to. Guessing shouldn't be necessary here. This commit makes sure that the KItemListView always returns a sensible parent in the accessible hierarchy. It does so by explicitly setting the accessible parent for every KItemListView after construction in the DolphinView contructor. Since KItemListView now always knows about its accessible parent, the accessibleInterfaceFactory can always ask the KItemListView for that information when constructing the QAccessibleInterfaces. Fixes https://invent.kde.org/system/dolphin/-/issues/47.
2023-09-10Merge remote-tracking branch 'origin/master' into kf6Méven Car
2023-09-10Replace qAsConst with std::as_constMéven Car
2023-09-02fix test in FreeBsd KItemListControllerExpandTest::testDirExpandMéven Car
2023-08-28Clean obsolete ifdefs since dolphin requires KF 5.101+Méven Car
2023-06-28Merge branch 'master' into kf6Méven Car
2023-05-26Expand or collapse all selected folders on Key Right/LeftMéven Car
CCBUG: 196772
2023-05-12Remove deprecated, ifdef'd code for old KIO versionsJakob Petsovits
2023-05-08Merge branch 'master' into kf6Méven Car
2023-04-25Revert "Adapt autotest to new expected "Space" key behaviour"Felix Ernst
This reverts commit df5cf6fe851021a73159fdd3487fe629c1ea8376. The autotest was orginally changed to adapt to new behaviour when the Space key is pressed. This change used to be implemented in KItemListController which meant that the KItemListControllerTest needed changing, but this is no longer the case. Instead the new behaviour when the Space key is pressed is now implemented further up the hierarchy, so the KItemListController change could be reverted in 7b6a67e520c04f56b4b05fa26b252177398df6df and as such we can also revert this autotest change.
2023-04-03Add test for openFiles()Felix Ernst
The basic mainWindow methods openFiles(), openDirectories(), isUrlOpen(), and isItemVisibleInAnyView() have some non-obvious behaviours that shouldn't regress. We never want to open directories that are already open. We only want to open new tabs when the currently open ones don't have the file that should be highlighted in view already. This should work even if view modes that allow folder expansion are in play. It should also work when the view area is split.
2023-03-04Rename KF5 to KF6Dāvis Mosāns
2023-02-05Add clang-format and format code as in FrameworksSerg Podtynnyi
2023-01-11Adapt autotest to new expected "Space" key behaviourFelix Ernst
The old expected behaviour was that pressing Space would select the current item. We now trigger selection mode instead and don't select. At some point in the future we might want to instead have Space trigger a "QuickLook" feature for quick viewing of full files. In any case, the old behaviour of having Space select is no longer expected, but Ctrl+Space can still be used for this. It might also make sense to have Space trigger the old selection behaviour if both selection mode and "QuickLook" are disabled, but that is very low priority and will cause more code complexity than the non-default benefits are worth.
2022-11-29Exit the deleted directory when it is removedMéven Car
If current directory is a local file, try to find nearest dir ancestor and open it. Display warning to the user.
2022-09-23Increase code coverage of places panel width resistance testFelix Ernst
Improve the test by also testing the various selection mode bars. No combination of bars should lead to a resize of the paces panel. This commit also helps with increasing code coverage by making all possible selection mode bars appear.
2022-07-07Improve goActions testFelix Ernst
This merge request fixes up a little oversight by me. I will merge this as soon as the pipeline passes. ------------------ Some lines verified that nothing is selected when navigating to a folder that was not acted on yet. These verifications didn't test anything meaningful because the folder in question was empty. This commit adds a file and a folder to the test folder so that testing if nothing is selected means something.
2022-07-07Add two autotestsFelix Ernst
- The first test makes sure that the width of the places panel doesn't change no matter what other panels are shown or hidden. There used to be bugs about this. - The second test is kind of an integration test. It makes sure that the go actions work correctly. On two occasions we had the regression here that after going "Up" in the file system hierarchy the folder one emerged from didn't have keyboard focus which makes peeking into multiple folders tiresome. The test also makes sure that going back and forward works as expected and there are some sanity checks about which go actions are enabled, which items are selected and that using tabs doesn't interfere with any of that.
2022-05-31Fix building kfileitemmodeltest with KF6Ahmad Samir
- Fix kio_version.h include - Explicitly create a QSet for QCOMPARE
2022-03-04Fix issue where newly inserted items end up in the wrong directoryDavid Edmundson
If we have directory "a" and "a/b" and expand both, then collapse "a" we tell KDirWatcher to stop watching both these directories. However, KDirWatcher keeps them in the listersCurrentlyHolding list as well as the listersCurrentlyListing list and will still notify of changes. If a new file appears in "a/b/" we will still get change notifications. When dolphin processes these changes we cannot find the relevant parent node. It then gets confused and inserts the item into the root directory from the POV of the model notifications. When we then open the relevant folder the model knows a node with that URL exists and fails to add it correctly. This can also be reproduced by continually downloading files into a subdirectory tree and rapidly expanding and collapsing folders a few levels deep.
2022-02-25[DolphinQueryTest] Fix class name duplicationIsmael Asensio
2022-01-14Adapt build system for building against qt6Laurent Montel
2022-01-11Remove KStandardItem and KStandardItemModelKai Uwe Broulik
They were used by the custom places panel and are now unused.
2022-01-09Port back to KFilePlacesViewKai Uwe Broulik
This removes the custom-view engine version of the places panel and replaces it with the upstream `KFilePlacesView` from KIO.
2021-12-19GIT_SILENT Port remaining QDateTime::toTime_t usage in windows code pathAlexander Lohnau
2021-12-13Port deprecated QDateTime::toTime_t method callAlexander Lohnau
2021-12-06Fix various typosluz paz
Found via `codespell -q 3 -S *.desktop,*.xml`
2021-11-28Properly display parent folders when filtering is active and items are added ↵Eduardo Cruz
or refreshed The methods slotRefreshItems(), slotItemsAdded() and slotItemsDeleted() are adapted so they are now compatible with the new behavior of filtering expanded folders achieved in ed83f37f06bd5c4b38c100503c3ad4dec2a87912. The new behavior is that expanded folders are hidden from view if neither the folder itself nor any of its contents passes the filter. Previously expanded folders would always stay visible no matter the filter. A bug where the parent expanded folder would disappear after adding or refreshing an item while filtering is also fixed. Tests are added to make sure these behavior changes won't regress. BUG: 442275 FIXED-IN: 22.04
2021-10-04Rewrite filter algorithm to properly support filtering with expanded folders ↵Eduardo Cruz
under Detail View mode. BUG: 411878 CCBUG: 442275 FIXED-IN: 21.12
2021-08-30Tabs: ensure to have folder icons for remote foldersMéven Car
KIO::iconForUrl relies on filename to find the icon for remote files. Appending / at the end of the filename allows it to interpret it as a folder. This causes inconsistent tab icons. To reproduce: Open in a tab a url on a smb or sftp folder, i.e sftp:/my-server/photos Before: Icon is a cloud. After: Icon is a folder Previously a folder icon could be presented if the tab was first opened with a url with a trailing /
2021-08-29Revert "Revert "Disable Hidden Files Last sort by default""Elvis Angelaccio
This reverts commit 272aa65bb55dd31f58e8a8e24ea7bc8bd2712daa.
2021-08-29Revert "Revert "Show hidden files and folders last""Elvis Angelaccio
This reverts commit 63e12c0cdf4e3437b95b9c50e5791dbf97183687.