kossebau created this revision. kossebau added reviewers: Plasma, Frameworks, dfaure. Restricted Application added a project: Plasma. Restricted Application added a subscriber: plasma-devel.
REVISION 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 thus resets any otherwise wanted state of the filewidget it has from previous setup calls via QFileDialog), 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. REPOSITORY R135 Integration for Qt applications in Plasma BRANCH fixFileDialogDirectoryWithSelectUrl REVISION DETAIL https://phabricator.kde.org/D3796 AFFECTED FILES autotests/kfiledialog_unittest.cpp src/platformtheme/kdeplatformfiledialoghelper.cpp EMAIL PREFERENCES https://phabricator.kde.org/settings/panel/emailpreferences/ To: kossebau, #plasma, #frameworks, dfaure Cc: plasma-devel, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas