Skip to content
Commit 816fc6f9 authored by Méven Car's avatar Méven Car
Browse files

[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:
1. Save a file using KFileWidget
2. Go to a folder with files and directories
3. Select a file
4. Select a directory
5. 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
parent a5830fa9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment