Skip to content
Commit 7bbbd93c authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Fix Plasma-QPA filedialog to show wrong directory with QFileDialog::selectUrl()

Summary:
QFileDialog does not set the initialDirectory option in codepaths from
QFileDialog::selectUrl(...) or QFileDialog::selectFile(...) when passing
the task on to the native widget. So KDEPlatformFileDialogHelper has to
make sure itself that info is kept.
Because KDEPlatformFileDialogHelper::initializeDialog() calls
setDirectory(options()->initialDirectory()); as intended, usually during
the show event. And by that it resets any otherwise wanted state of the
filewidget it had from previous setup calls via QFileDialog, and instead
to whatever value the initialDirectory option had before, usually the
working directory as set during initialization.

Test Plan:
New unit test kfiledialog_unittest testSelectUrl no longer fails with added
code, also behaves now as expected with code e.g. from KUrlRequester.

Reviewers: #plasma, #frameworks, dfaure

Reviewed By: #plasma, graesslin, dfaure

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D3796
parent 5b5549ab
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