Bug 402602 - Pasted file is not selected if a file/folder was already selected in destination
Summary: Pasted file is not selected if a file/folder was already selected in destination
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 22.12.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 413388 421689 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-12-27 12:35 UTC by Patrick Silva
Modified: 2023-11-16 16:39 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2018-12-27 12:35:28 UTC
STEPS TO REPRODUCE
1. open two dolphin windows with different locations
2. select a file/folder in window A
3. copy/cut some file in window B
4. use ctrl+v to paste the file in window A

OBSERVED RESULT
The file pasted in window A is not selected.
The file/folder selected in the step 2 is selected instead.

EXPECTED RESULT
The file pasted in window A is selected.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.14.4
Qt Version: 5.12.0
KDE Frameworks Version: 5.53.0
Comment 1 Nate Graham 2018-12-28 21:24:47 UTC
Can confirm, but only when the file in window A is still selected. When nothing is selected, pasting the item does indeed select the newly-pasted file.

It would appear that this behavior is deliberate. From Dolphinview.cpp::updateViewState():

        // if there is a selection already, leave it that way
        if (!selectionManager->hasSelection()) {
            const int currentIndex = m_model->index(m_currentItemUrl);
            if (currentIndex != -1) {
                selectionManager->setCurrentItem(currentIndex);

Not sure if this is something we should change. Probably a maintainer decision. Elvis?
Comment 2 Patrick Silva 2019-10-24 16:15:30 UTC
*** Bug 413388 has been marked as a duplicate of this bug. ***
Comment 3 Patrick Silva 2020-01-18 13:34:28 UTC
easier way to reproduce:
open Dolphin and copy any file
open another folder cpntaining at least 1 folder/file
select the file/folder already present
paste the file copied in the first step by pressing ctrl+v
Comment 4 MM 2021-02-25 09:22:49 UTC
IMHO this is a bug and should be fixed. This is because the behavior is inconsistent. 

If there is no other selected file, then the pasted one gets selected. If there is another file selected, then it is NOT selected.

Also, take this scenario: I have a template file, say an invoice, and I need to copy it, edit it, and send it away. So I copy it, and paste it in place. The rename file dialog appears, so I rename it (notice that I am working on the copy now!). When the dialogue closes, the file I just acted upon is not selected, the other one is. This is unexpected and hard to notice, so I press Enter to edit it... and I am editing the template instead of the intended file.

Also, when pasting and renaming, the just-pasted file may well slide beyond view (if there are many files and the new name is far away).

In fact I am here because I just messed up a few folders like this. I hope it can be fixed soon!
Comment 5 Nate Graham 2021-06-14 14:11:03 UTC
*** Bug 421689 has been marked as a duplicate of this bug. ***
Comment 6 Patrick Silva 2023-11-16 16:39:07 UTC
Cannot reproduce with Dolphin 23.08.3.