┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests
AgeCommit message (Collapse)Author
2026-02-21viewproperties: don't use intermediate tmp file to save viewpropsMéven Car
2026-01-21Add keyboard anchor assignments to mouse eventsTomasz Kot
The mouse events need to modify the keyboard anchor assignments as well, because selecting an item with a mouse and then navigating with keyboard wouldn't follow the same selection. BUG: 508609
2026-01-20dolphinview: when creating a subfolder expand to it if in details modeMéven Car
So the new folder is in view.
2026-01-12viewproperties: remove temp file after loading defaultConfigSergey Katunin
It turns out that since f6c97d52220be9bd996b71309051e56ff7aa1834 a temp file is created here with each `save()` call for this default config, which is not deleted later. In another place where `defaultProperties()` is called for `m_node`, the file is deleted in the destructor of this class. But it is not deleted here. So, remove temp file after loading defaultConfig or it will create temp file on each save() operation in /tmp folder. Also keep the global/.directory file when xattr isn't supported. BUG: 510500
2026-01-10Use Q_ASSERT instead of Q_CHECK_PTR for plain checks of pointer valueFriedrich W. H. Kossebau
Q_CHECK_PTR (other than the name suggests) is intended only to check the success of memory allocations. Using it for any pointers instead can be misleading due to the "Out of memory" log printed in case of hits.
2025-11-12Revert "Avoid implicitly selecting items"Nate Graham
This reverts commit 122fee5625f0285ec4ebda79162c72390989eb2a. This behavior change was well-intentioned, but has significant usability and speed drawbacks that have not been addressed: - Keyboard-driven folder manipulation became slower - Unexpected behavioral differences when opening files with the pointer compared to when opening them with the keyboard introduced inconsistency and cognitive load - Unexpected opening of selection mode during fast operation introduced the potential for confusion and additional errors - Dolphin's behavior became inconsistent with that of other file managers users may be accustomed to The bug tracker, discuss.kde.org, and Reddit are full of complaints about this change. It's been a year now; I think it's clear that many Dolphin users have not gotten used to and accepted it. I have to count myself as one of them, I'm afraid. I've tried to get used to it for a year, but I just have not been able to. I don't believe the benefits of this change outweigh the drawbacks, so let's revert it. 24d859cf19e90fa22ed687b36a68231625c1bd80 was explicitly mentioned as a thing that should also be reverted in this case, but it's already been done. BUG: 494125 BUG: 511966 CCBUG: 424723 CCBUG: 492404 FIXED-IN: 25.12.0
2025-11-10dolphin: improve keyboard search behavior for repeated charactersweinan li
The original keyboard search implementation had a limitation when dealing with files containing repeated characters like 44.txt. When typing 44, it would trigger rapid navigation to the next item starting with 4 instead of matching the full string 44. This patch introduces a smarter search strategy: 1. First attempt full string matching for exact file names 2. If full match fails and user is typing repeating characters, fall back to rapid navigation using either: - Last successful search string (for extended searches like 444 -> 4444) - First character only (original rapid navigation behavior) The changes include: - Modified changeCurrentItem signal to include a found parameter for search result feedback - Added m_lastSuccessfulSearch to track successful searches for better fallback behavior - Used Qt::DirectConnection to ensure synchronous execution for immediate result feedback This provides better user experience when searching for files with repeated characters while maintaining the rapid navigation feature for quick browsing. BUG: 501851
2025-10-23dolphinmainwindotest: harden some testsMéven Car
2025-10-23dolphinmainwindowtest: prevent kaboutdata warningsMéven Car
2025-10-21Fix a couple compiler warningsMéven Car
2025-10-03Add integration test for split view activation and tab title update after ↵Wendi Gan
renaming a folder In a split-view tab, the child folder is opened in the left view and other tabs, while the parent folder is opened in the right view. After renaming the child folder from the right view: - The activated view should not switch to the left view. - All tab titles should be updated. CCBUG: 496414
2025-09-03Fix several user-facing and non-user-facing typosKunda Ki
Found via `codespell -S "*.desktop,*.po,*.svg,*.xml,./po" -L aparent,childs,goup,lokal`
2025-06-28clean includeMéven Car
2025-05-28dolphinview: Add a dynamic view optionVictor Blanchard
Added a 'dynamic view' option, which allows to switch from a 'compact' or 'details' view to an 'icons' view if most of the files in the directory are images or videos. It reverts to the previous view mode when we switch to a directory which doesn't meet that criteria. The view mode is only changed once so users don't have to undo that for specific folders when they don't want icon view. A setting is added in the "Display style" section of the general view setting page. BUG: 491139
2025-04-29Clazy fixMéven Car
2025-04-07Rewrite search integrationFelix Ernst
This huge commit is a nearly complete rewrite of the Dolphin search code. It implements most of the improved Dolphin search UI/UX as designed and discussed in a collaborative effort by Kristen McWilliam, Jin Liu, Andy Betts, Tagwerk, a few others and me. See https://invent.kde.org/system/dolphin/-/issues/46. # Notable changes - A toggle to change the search tool is provided as most contributors deemed that useful in https://invent.kde.org/system/dolphin/-/merge_requests/642#note_985112. - The default search is changed to filenamesearch for maximum reliability. - Removing all search parameters will take users back to the view state prior to starting a search instead of keeping the search results open. - The UI for choosing file types or modification dates has been made more powerful with more granularity and more options. - Most search parameters can be configured from a popup menu which gives us extra space for extra clarity. - Labels and help buttons as well as hyperlinks to settings makes sure the user always knows why some search parameters are unavailable in some contexts. - Chips show important search parameters while the popup is closed. They allow quickly removing filters. - The titles of the search and the input field placeholder message change to make clear whether file names or file contents are searched. - When the user actively switches the search tool, whether content should be searched, or whether to search everywhere, this is preserved for the initial state of the search bar when the user opens it the next time after restarting Dolphin. # Architecture - The new DolphinQuery class is independent of the UI and contains all search parameters modifiable in Dolphin as easy setters and getters. - DolphinQuery objects are also used to update the states of every component in the search UI. There is now a clear separation of UI and search configuration/DolphinQuery. - DolphinQuery is responsible for exporting to and importing from search URLs. - The search UI always reflects the currently configured DolphinQuery no matter if the user changed the UI to change the DolphinQuery or loaded a DolphinQuery/older search URL which then is reflected in the UI. - I tried to simplify all classes and their interaction between each other as much as possible. - I added some tests BUG: 386754 CCBUG: 435119 CCBUG: 458761 BUG: 446387 BUG: 470136 CCBUG: 471556 CCBUG: 475439 CCBUG: 477969 BUG: 480001 BUG: 483578 BUG: 488047 BUG: 488845 BUG: 500103 FIXED-IN: 25.08
2025-02-24Add smaller statusbar and set it as defaultAkseli Lahtinen
- Statusbar has three modes: Small, FullWidth and Disabled - FullWidth is the original statusbar - Small is the new default statusbar - This statusbar overlays on top of the items instead of taking space - It changes size according to content - Disabled turns statusbar completely off - Zoom slider and space information is only shown in full-width statusbar - Space information is now always on - If user navigates with keyboard, or scrolls to selection, the scrolling will take the statusbar into account - This makes sure the statusbar does not cover any items Related discussion: https://invent.kde.org/system/dolphin/-/issues/50
2025-02-22kitemlistkeyboardsearchmanager: smarter search start positionYifan Zhu
Search from the next position for new search and special repeated key search. Otherwise search from the current position, which is current selected item if something is selected or in selection mode, and 0 (the beginning) otherwise. Test plan: - create directory with files ab1, ab2, and ab3 - click ab2, and press escape to deselect - type ab; verify that ab1 is selected - wait a while, type ab again, verify that ab2 is selected - wait a while, type ab again, verify that ab3 is selected - click ab1, type ab, verify that ab2 is selected BUG: 422951
2025-02-20kitemlistcontrollertest: fix warningsMéven Car
NO_CHANGELOG
2025-02-08viewpropertiestest: simplify two testsMéven Car
2025-02-08Viewproperties: prevent loosing view settingsMéven Car
When they match the hardcoded internal settings, when they should be kept as long as they don't match the currently set default viewproperties. Is saved in metadata the diff with the hardcoded internal defaults still. A stable default reference allows to change defaults without changing existing saved viewproperties. CCBUG: 495878
2025-02-03implement shortcut action for file creationChristian Schwarz
BUG: 462899
2025-02-01Ignore diacritical marks for keyboard searchThomas Moerschell
When using keyboard search, normalize the item names and remove marks first. Now, items containing characters with marks can be found using keyboard search. BUG: 482394
2025-01-30Change three view buttons into one with menu arrowAkseli Lahtinen
Instead of showing three buttons, which is quite visually noisy, show only one button that is split: First button, when clicked, loops through the view modes. Second smaller button with the down arrow shows menu of the available view modes. See also https://invent.kde.org/system/dolphin/-/issues/68#toolbar-button-changes Alternative for https://invent.kde.org/system/dolphin/-/merge_requests/893 ![Screencast_20250121_123718](/uploads/e8625c485c58a9c47e8168106b3e7419/Screencast_20250121_123718.mp4)
2024-12-29Have special keyboard controls in selection modeFelix Ernst
Prior to this commit keyboard controls and behaviour of Dolphin's main view were identical no matter if selection mode was enabled or not. While selection mode makes it impossible to accidentally clear the selection by singular mouse clicks, any press of an arrow key on the keyboard would still clear the full selection which goes against selection mode's objective. Furthermore, keyboard-only users had no reason to ever enable selection mode because it made no difference to them. This commit changes this by offering a changed control scheme for key presses while in selection mode. Arrow key presses without modifier now only move focus between items but do no longer clear or change the selection. Similarly, Page Up/Down, Home, and End key presses only move keyboard focus. Enter, Return, and Space key presses now only toggle the selection for the current item. The above controls are however mostly unchanged when combining them with Modifier keys like Shift or Control. The type-ahead feature is also changed in selection mode to only move keyboard focus without changing the selection. This way keyboard users are less likely to clear their selection by mistake. Regression tests are added for these selection mode controls. The code changes to change this keyboard behaviour are quite minimal. Most of the added code is for making selection mode accessible. That's because we need to make sure the changed control scheme is properly announced and communicated or a blind user will be left utterly confused why the normal keyboard controls "stopped working". Enabling or disabling selection mode is announced to accessibility software. Furthermore whenever focus goes to the main view, the selection mode state is also mentioned when active. BUG: 458091
2024-12-19dolphinview: Update thumbnail on filename changeAkseli Lahtinen
If filename of an item was updated previously, it would modify the model before the file was actually changed. This led to the model calling a signal that would try to run a previewjob, but since the filename is not actually changed yet on disk, it would fail. This patch moves the model updating after copyjob. Copyjob will take care of the file renaming if there is already existing file. We just need to update the model correctly after the job has succeeded. BUG:497555
2024-12-16ViewProperties: Return nullptr if viewPropertiesString is emptyAkseli Lahtinen
If viewPropertiesString is empty, return a nullptr. This will later used in the stack by the defaultProperties call. In defaultProperties, if we can't find the global directory, create new one with a tempfile. If tempfiles can't be created, use default instead. This will ensure that view settings are saved and loaded correctly if user has separate view properties per folder. This will also add an unit test, where we create a global directory, modify it and make sure the changes are reflected in the unmodified folder. BUG:495878
2024-12-09Fix inline renaming multiple files when renaming changes sorting orderIlia Kats
Suppose we are renaming file i and the new name will be sorted after file i+1. We are now pressing ArrowDown to immediately start renaming file i+1. However, because of the sorting we would not actually end up renaming what used to be file i+1. What would happen is that editing would be started in dolphinview.cpp:2065. However, after 100 ms the timer in KFileItemModel would fire, resulting in the model emitting itemsMoved(). This would trigger doLayout() in KItemListView::slotItemsMoved(). doLayout() resizes the KItemListWidgets, wich causes the renaming to be canceled in KStandardItemListWidget::resizeEvent(). Now, we start a new renaming operation for the correct widget after the relayouting is complete.
2024-12-04Always focus the view after place activationFelix Ernst
This one-liner makes sure keyboard focus always moves to the active view when a place in the places panel is activated. Previously focus would remain on the places panel if the activated location was identical to the already displayed location. This added consistency is helpful because keyboard-only users will get used to be able to move from the places panel to the view by pressing the Enter key, even though this does not always work prior to this commit. This issue was identified in an accessibility scan done by HAN University of Applied Science.
2024-11-19natural sort: exclude extension when comparing filenamesEren Karakas
Currently natural sort compares the entire filenames (basename.extension) when sorting. This causes eg. "a 2.txt" to appear before "a.txt" when sorted by ascending. This is unintuitive since people prioritize basenames more than file extensions. Instead, change natural sort to compare by basename only and fallback to comparing extensions if basenames were equal. This change causes "a.txt" to appear before "a 2.txt" and matches how other platforms such as GNOME and Windows behave. BUG: 416025 BUG: 470538 BUG: 421869 BUG: 312027
2024-11-12Test that each object has distinguishable accessible infoFelix Ernst
This commit extends the dolphinmainwindowtest for the accessible tree to test that each object a user can reach through the Tab key or the Shift+Tab key combination is distinguishable by its accessible info from the previous object. Objects are considered distinguishable if they have different accessible names or their first ancestor with an accessible name is different.
2024-10-31Make Escape move focus from location bar to viewFelix Ernst
Pressing Escape on the location bar while in breadcrumb mode has no effect at all. This commit changes this to instead move the focus to the active view. This is more logical because a user pressing escape while having focus on the location bar is no longer interested in interacting and changing the location in the location bar. They most likely want to act on the current location instead.
2024-10-31refactor: replace QString() with QStringLiteral() for better performanceZhangzhi Hu
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