Summary: | KFileDialog.getSaveUrl places last part of startDir parameter also in filename field | ||
---|---|---|---|
Product: | [Unmaintained] kfile | Reporter: | Wilbert Berendsen <wbsoft> |
Component: | general | Assignee: | kdelibs bugs <kdelibs-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jjm |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | The dialog yielded by the above statement |
Created attachment 34174 [details]
The dialog yielded by the above statement
The Name field displays 'test', but should be empty.
Patch submitted at http://reviewboard.kde.org/r/803/ Great! Does this patch also fix the same issue in the KEncodingFileDialog class? (this exhibits the same problem as the regular KFileDialog). btw the python example wasn't complete: of course one should also create a KApplication() before the example will work :-) Regarding comment #3: the save cases of KEncodingFileDialog also use setSelection and so may well have the same problem. I'll update the patch to also simplify those - there is no need to handle the startDir parameter specially. SVN commit 990505 by marten: Handle the cases where a directory (without filename) is passed to one of the KFileDialog::getSaveFile* functions. Don't handle the startDir parameter to these (or any other of the static functions) in any way specially, just pass it straight in to the constructor. This and KFileWidget will take care of parsing and checking the parameter. Ensure that the KFile::LocalOnly option is set for the getSaveFile* functions. Removed kWarning() for a non-local file in these - if anything is to be done about non-local files then it should be in KFileWidget. Also pass the parameter straight through for the KEncodingFileDialog static functions. Reviewed at http://reviewboard.kde.org/r/803/ BUG:194900 M +2 -9 kencodingfiledialog.cpp M +28 -46 kfiledialog.cpp M +58 -7 tests/kfiledialogtest.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=990505 |
Version: (using KDE 4.2.2) OS: Linux Installed from: Ubuntu Packages When I call KFileDialog.setSaveUrl (and the other save dialogs in KFileDialog and KEncodingFileDialog) with a directory in the startDir parameter, the dialog is displayed with in the specified directory (which is OK), but also with the name of the directory (i.e. the last part of the given path) in the Name entry field (which is not Ok). I would expect the Name field to be empty, and with keyboard focus, like the different open dialogs do. This happens whether or not I append a slash to the directory. Example (typed from Python): >>> from PyKDE4.kio import * >>> KFileDialog.getSaveFileName(KUrl('/home/wilbert/test/'))