From 122fee5625f0285ec4ebda79162c72390989eb2a Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Sat, 18 May 2024 22:18:14 +0000 Subject: Avoid implicitly selecting items 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 --- src/dolphinviewcontainer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/dolphinviewcontainer.cpp') diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index ef58abee0..6eff70f9b 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -868,7 +868,8 @@ void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl &url) void DolphinViewContainer::slotUrlSelectionRequested(const QUrl &url) { - m_view->markUrlsAsSelected({url}); + // We do not want to select any item here because there is no reason to assume that the user wants to edit the folder we are emerging from. BUG: 424723 + m_view->markUrlAsCurrent(url); // makes the item scroll into view } -- cgit v1.3