D25420: [KFileWidget] Avoid calling slotOk right after the url changed

Méven Car noreply at phabricator.kde.org
Wed Nov 20 12:08:24 GMT 2019


meven created this revision.
meven added reviewers: Frameworks, ngraham.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
meven requested review of this revision.

REVISION 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 _k_slotViewKeyEnterReturnPressed to call slotOk when it is called subsequently after the kdiroperator emitted urlEntered.
  
  The patch also allows directories to be selected using Enter when the KDirOperator has no selection.
  
  BUG: 412737
  FIXED-IN: 5.65
  
  Relates to D19824 <https://phabricator.kde.org/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.

REPOSITORY
  R241 KIO

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D25420

AFFECTED FILES
  src/filewidgets/kfilewidget.cpp

To: meven, #frameworks, ngraham
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191120/4149cb9a/attachment.html>


More information about the Kde-frameworks-devel mailing list