Summary: | Save Dialogues prematurely save when using keyboard navigation to enter directory | ||
---|---|---|---|
Product: | [Unmaintained] kfile | Reporter: | Dotan Cohen <kde-2011.08> |
Component: | general | Assignee: | kdelibs bugs <kdelibs-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | hugo.costelha, stefan, wstephenson |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Dotan Cohen
2009-08-31 13:28:48 UTC
I agree. I work almost exclusively with the keyboard, but for saving files I currently have to use the mouse because of this bug. That's a very annoying. Proposed fix http://reviewboard.kde.org/r/3435/ SVN commit 1111606 by wstephens: This patch solves the problem that the Enter/Return keys cannot be used when saving files to navigate into a folder in KFileDialog. What happens is that the navigation in KDirOperator works, but the key event is also caught by the KFileDialog itself and passed to KDialog, oking the dialog. Cursoring over a file in the KDirOperator populates the location widget, so a filename is provided and the dialog is valid. This patch consumes the Enter/Return key event in a new KDirOperator::keyPressEvent(QKeyEvent*). This change should be sufficient to solve the problem, but past changes to the code have made the control flow complex and different when loading and when saving files. Without the Enter/Return key press event reaching KDialog, the user cannot save a file by selecting it and pressing Enter. This is for 2 reasons: 1) r891277 by ereslibre in KFileWidget::_k_fileSelected() prevents the KDirOperator::fileSelected() signal from invoking slotOk(), to "give the user a chance to amend the filename after selecting a file". 2) r895027 by ereslibre suppresses the KDirOperator::fileSelected() signal from being emitted when the isSaving flag is set on KDirOperator, when an item is activated, in order to respect KDE's double-click/single-click activate policy. This is redundant because QAbstractItemView::activated() is controlled by KStyle according to KDE click policy (http://apaku.wordpress.com/2008/06/23/itemviews-with-kde-styles-adhere-to-kde-settings/). Since the behaviour change in 2) to KDirOperator::fileSelected() was masked by the propagated Enter/Return, is redundant for its goal, and was undocumented, the patch removes it. The additional chance to amend the filename behaviour is inconsistent with single click policy and gives different behaviour in between load and save mode, but is useful since no select/deselect buttons appear on hover in KDirOperator's views yet, so I have kept that and improved it by focusing the location widget after a file item is activated. BUG: 205781 M +8 -1 kdiroperator.cpp M +2 -0 kdiroperator.h M +3 -1 kfilewidget.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1111606 *** Bug 115251 has been marked as a duplicate of this bug. *** |