[KFileWidget] Avoid calling slotOk right after the url changed
Summary:
When _k_slotViewKeyEnterReturnPressed is called, KDirOperator::_k_slotActivated is called first potentially opening another directory.
And since the directory changed, the kdiroperator selection is empty, causing then kiowidgets-kdirmodeltest to call slotOk and if a filename was present in the filename field, it will cause the dialog to accept() prematurely.
This patch prevents KDirOperator::keyEnterReturnPressed to be emitted when QAbstractItemView::activated would be, preventing the issue in the first place.
BUG: 412737
FIXED-IN: 5.65
Relates to D19824
Test Plan:
- Save a file using KFileWidget
- Go to a folder with files and directories
- Select a file
- Select a directory
- Hit Enter
Before:
The directory is opened briefly and the dialog returns.
After:
The selected directory is opened.
Reviewers: Frameworks, ngraham, elvisangelaccio, dfaure
Reviewed By: ngraham, dfaure
Subscribers: ahmadsamir, feverfew, kde-frameworks-devel
Tags: Frameworks
Differential Revision: https://phabricator.kde.org/D25420