Bug 323946 - When renaming files the highlighted part of the filename before the extension behaves strangely.
Summary: When renaming files the highlighted part of the filename before the extension...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Unclassified
Component: general (show other bugs)
Version: 4.10.5
Platform: Fedora RPMs Linux
: NOR minor (vote)
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-23 22:31 UTC by Georgiy Treyvus
Modified: 2013-09-05 14:58 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georgiy Treyvus 2013-08-23 22:31:52 UTC
When I rename a file Dolphin like most other graphical file managers highlights the part before the extension. However it behaves very differently from every other file manager I've seen when I use the arrow keys.

Say I'm trying to rename "abcdefg.hij". The "abcdefg" part is highlighted exactly as it should be. I don't know if it's just me but often when renaming files I often add things to the beginning of the file name or the end of the file name right before the extension.

If I'm trying to add something to the beginning of the file since everything but the extension is highlighted what I expected was that pressing left exits the highlight and moves the cursor to the beginning of the file name like in every other file manager. Unfortunately Dolphin moves the cursor only one character to the left when it exits the highlight.

There are two workarounds. The first is the clunky one of pressing left multiple times or holding left until you're at the beginning of the file name. The other approach of pressing the Home key is much quicker and is in fact as fast as pressing left should be but it still feels counter-intuitive, awkward, and out of line.

On other file managers pressing right exits the highlight and moves the cursor to the end of the highlighted area. What Dolphin does instead is it exits the highlight and move the cursor one position to the right beyond the end of the highlighted area. Pressing the left arrow key puts the cursor back where it should be so working around this is not a problem but again it just feels awkward and unnatural in comparison to literally everything other graphical file manager out there.

This is a minor bug and really is trivial to work around. Nonetheless this behaviour messes with the user's intuition of such things and is quite annoying.

Reproducible: Always
Comment 1 Frank Reininghaus 2013-08-24 17:55:11 UTC
Thanks for the suggestion.

I don't think that there is any straightforward way to implement the behavior you are suggesting. It violates the property that there is always a well-defined cursor position, and that Left/Right change this position by one.

Therefore, one would have to write a new text editing widget that supports the behavior you want. AFAIK, those provided by Qt and kdelibs do not support such a thing.
Comment 2 Christoph Feck 2013-08-24 21:48:36 UTC
Interestingly, it works on Konqueror URL input line. Pressing the cursor keys places the cursor at the begin or end of the selection and cancels it.
Comment 3 Christoph Feck 2013-08-24 21:55:29 UTC
Actually, it works for me everywhere (even in plain QLineEdit), except in the Dolphin inline rename box.
Comment 4 Frank Reininghaus 2013-08-25 07:29:21 UTC
Thanks Christoph, I wasn't aware of that. However, it seems that the K/QTextEdit which we use does not support this feature.
Comment 5 Christoph Feck 2013-08-25 15:46:07 UTC
Git commit d55211687cc002e3650aa286b09523186a21a510 by Christoph Feck.
Committed on 25/08/2013 at 15:40.
Pushed by cfeck into branch 'KDE/4.11'.

Move cursor to begin/end of selection before canceling it

Makes Left/Right keys consistent with QLineEdit behavior.
FIXED-IN: 4.11.1
REVIEW: 112256

M  +16   -0    dolphin/src/kitemviews/private/kitemlistroleeditor.cpp

http://commits.kde.org/kde-baseapps/d55211687cc002e3650aa286b09523186a21a510
Comment 6 Tsu Jan 2013-09-05 13:37:35 UTC
This isn't directly related to this (fixed) bug, but I think something similar should be done for the folder view plasmoid and even for Kate. As for Kate, that could be a matter of opinion.

BTW, with rtl strings as file names, isRightToLeft() could be used as an extra condition.
Comment 7 Frank Reininghaus 2013-09-05 14:11:05 UTC
(In reply to comment #6)
> This isn't directly related to this (fixed) bug, but I think something
> similar should be done for the folder view plasmoid and even for Kate. As
> for Kate, that could be a matter of opinion.

Then please tell the FolderView/Kate people about that. It's very unlikely that they will read the comments for Dolphin bug reports ;-)
Comment 8 Tsu Jan 2013-09-05 14:49:32 UTC
> Then please tell the FolderView/Kate people about that.
OK, thanks. I'll do so.

Please also take the rtl case into consideration.
Comment 9 Frank Reininghaus 2013-09-05 14:58:38 UTC
(In reply to comment #8)
> Please also take the rtl case into consideration.

Please do not report multiple problems in one bug report, or new problems in a report that is already closed. This makes it impossible to keep track of the things that still need to be done, considering that only very few people are working on Dolphin in their spare time.