Bug 162964 - Weird initial selection in open file dialog
Summary: Weird initial selection in open file dialog
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources All
: NOR normal
Target Milestone: ---
Assignee: Jarosław Staniek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-01 00:00 UTC by Robin Pedersen
Modified: 2009-04-03 10:07 UTC (History)
3 users (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 Robin Pedersen 2008-06-01 00:00:10 UTC
Version:            (using Devel)
Installed from:    Compiled sources
Compiler:          GCC 4.2.3 
OS:                Linux

I've seen this in both kwrite and kate, both 4.1 beta 1 and current SVN. After debugging with kate, I have concluded that the bug is in KFileDialog.

When selecting to open a file, kate calls KEncodingFileDialog::getOpenUrlsAndEncoding(), with the url of the currently viewed file initially selected ("startDir" argument). However, I've tried both using KFileDialog::getOpenUrls() and creating a KFileDialog manually. In all cases, I get the same result.

The first time an open dialog is shown, the initial selection is as expected. The location editor contains the file name without quotes, and the whole name is selected, to that I can quickly type the name of another file, and press enter to open it. This is the same behavior as KDE3, and how it should be.

Every time a new file dialog is shown, after the first, the initial selection is different. The location editor contains the file name like the first time, but now it's quoted, and there's no selection. The cursor is at the end of the content (outside the closing quote).

Now I have to manually clear the editor before I can write the name of another file to open. This is very annoying.
Comment 1 FiNeX 2008-06-02 01:07:03 UTC
Confirmed. It is not a good behaviour. The line-edit should be cleaned.
Comment 2 Jarosław Staniek 2008-07-01 17:22:48 UTC
Confirmed. I am looking at the issue.
Comment 3 Jarosław Staniek 2008-07-01 20:11:32 UTC
I have reverted these commits locally:
http://websvn.kde.org/?view=rev&revision=822150
http://websvn.kde.org/?view=rev&revision=820289

I still can see the same behaviour (unless I have missed someting subtle). 

My proposal (in a case I am right) is to strip for the file name out of the startDir url when KAbstractFileWidget::Opening mode is used.
Comment 4 Dario Andres 2009-04-03 01:24:57 UTC
Any news on this ?

I can't recognize the described behaviour on current trunk:

Qt: 4.5.0 + qt-copy-patches-936035
KDE: 4.2.68 (KDE 4.2.68 (KDE 4.3 >= 20090327))
kdelibs svn rev. 946159 / kdebase svn rev. 946160
on ArchLinux i686 - Kernel 2.6.28.8

Thanks
Comment 5 Robin Pedersen 2009-04-03 08:43:58 UTC
It seems to be fixed. I don't know why it hasn't been closed.
Comment 6 FiNeX 2009-04-03 10:07:31 UTC
I confirm it has been fixed :-)