Bug 159862 - Dolphin: paste action doesn't work with file selected.
Summary: Dolphin: paste action doesn't work with file selected.
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-25 23:31 UTC by FiNeX
Modified: 2008-03-29 08:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description FiNeX 2008-03-25 23:31:40 UTC
Version:           Revision 789930 (using Devel)
Installed from:    Compiled sources
OS:                Linux

On dolphin, the "paste" action is not activated when even one file is selected. This shouldn't be.
Try to:
1) select some files
2) CTRL+C for copying the files
3) CTRL+V, this doesn't work if the files are selected.
Comment 1 Peter Penz 2008-03-26 08:45:25 UTC
Hmm, I've to think about this in detail. If we ignore the selection when pasting, then it won't be possible anymore pasting into a selected sub directory by e. g. pressing Ctrl+P (not sure if this is really wanted without using the context menu).

Currently it is handled this way in Dolphin:
- no file selected: 'Paste' pastes into the current directory
- one directory selected: 'Paste' pastes into the selected directory
- n files selected: 'Paste' is deactivated

Possible improvements which come into my mind:
a) Deselect all files after pressing "Copy"; but on the other hand this would be a different behavior than in other file managers... Not good.
b) Ignore the selection completely and paste always into the current directory (this would be compliant to e. g. the Windows Explorer or Konqueror in KDE 3).

I think solution b) is the way to go... What do you think? I'll also check how Konqueror in KDE 4 behaves, so that we have a similar behavior.

I personally always deselected the selection before pressing paste, so I never was aware about the Dolphin behavior seems to be different in this case to other file managers...

(as an internal not to David: this would mean that 'Paste' from the context menu has a different behavior as when pressing 'Paste' from the edit menu; in the Windows Explorer this seems to be the case too: no shortcut is shown in the context menu for 'Paste')
Comment 2 David Faure 2008-03-26 12:16:16 UTC
On Wednesday 26 March 2008, Peter Penz wrote:
> Hmm, I've to think about this in detail. If we ignore the selection when pasting, then it won't be possible anymore pasting into a selected sub directory by e. g. pressing Ctrl+P (not sure if this is really wanted without using the context menu).


Ctrl+P? Strange shortcut, that's usually "print", in 99% of the kde applications.

> Currently it is handled this way in Dolphin:
> - no file selected: 'Paste' pastes into the current directory
> - one directory selected: 'Paste' pastes into the selected directory


Ouch. Been there, done that, bad idea :) As shown by this report.

> b) Ignore the selection completely and paste always into the current directory (this would be compliant to e. g. the Windows Explorer or Konqueror in KDE 3).


Yes.

> I think solution b) is the way to go... What do you think? I'll also check how Konqueror in KDE 4 behaves, so that we have a similar behavior.


Konqueror delegates all this to the dolphin part, except for the context menu :)

> (as an internal not to David: this would mean that 'Paste' from the context menu has a different behavior as when pressing 'Paste' from the edit menu; in the Windows Explorer this seems to be the case too: no shortcut is shown in the context menu for 'Paste')


In konqueror's popupmenu there's support for "paste" and "pasteto" actions. The "paste" action is used to paste into the current directory (so that one is the action from the menu),
while the "pasteto" action is created only for the popupmenu, and is used when right-clicking a directory [so this is about where you right-click, not really about selection, btw].
Comment 3 Peter Penz 2008-03-26 12:25:15 UTC
> Ctrl+P? Strange shortcut, that's usually "print",
> in 99% of the kde applications. 

Ah, meant Ctrl+V :-) I use this shortcut all the time, but if I have to _think_ about which shortcut is used for pasting, it seems I'm completely lost...

> Ouch. Been there, done that, bad idea :) As shown by this report. 

OK, I'm convinced! I'll fix this to b)...
Comment 4 FiNeX 2008-03-26 13:02:46 UTC
"b" even for me.

Summarizing, the final behaviour should be:
 - no file selected: 'Paste' pastes into the current directory 
 - one directory selected: 'Paste' pastes into the selected directory 
 - n files selected: 'Paste' pastes into the current directory

:-)
Comment 5 Peter Penz 2008-03-26 13:35:50 UTC
> Summarizing, the final behaviour should be:
> - no file selected: 'Paste' pastes into the current directory
> - one directory selected: 'Paste' pastes into the selected directory
> - n files selected: 'Paste' pastes into the current directory

Although this would be the most simple way for me to implement, I think that point 2:

> - one directory selected: 'Paste' pastes into the selected directory

is still a problem: I got a bugreport recently which claimed that "Paste accidently pastes a folder into itself". I've added an additional warning message box to ask the user whether this is intended, but I think the root of the issue is the following use case:
- user selects a directory
- user presses 'Paste' and wants to have a copy of the directory within the same folder

So I'd propose: Paste just always pastes into the current directory and ignores the selection (it works also this way e. g. in the Windows Explorer and AFAIK in Konqueror for KDE 3). Only when the user opens a context menu on a directory and invokes 'Paste', then a pasting is done into this directory.

Is this OK?
Comment 6 FiNeX 2008-03-28 09:43:10 UTC
Good question Peter. Probably there are people which like a behavior, and others which will like the other one.

Actually, Konqueror for KDE3 paste into the current directory, ignoring the selection, it paste into a selected directory only by invoking the context menu, as you proposed. So you could keep this way.
Comment 7 Peter Penz 2008-03-29 08:44:29 UTC
SVN commit 791354 by ppenz:

The paste operation should ignore the current selection to behave similar as Konqueror and other file managers. Only if a context menu for a folder is opened, a pasting should be done into this folder.

Some internal cleanups are still required (see TODO comments), so that after finishing the operation an indication can be given to the user in the statusbar (must go for breakfast now, otherwise I'll eat my keyboard...).

BUG: 159862

 M  +37 -2     dolphincontextmenu.cpp  
 M  +5 -0      dolphincontextmenu.h  
 M  +2 -44     dolphinview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=791354