Previously KDEPlatformFileDialogHelper::selectFile() would change
options()->initialDirectory() unconditionally even if it was already
set by the QFileDialog code. Since Qt 5.7.1 it is no longer necessary
to derive initialDirectory from the selectFile() call. In fact it is
actuall harmful since it will now override the correct initial directory
that was set by Qt. Without this patch I got the following debug output:
KDEPlatformFileDialogHelper::setDirectory QUrl("sftp://server/home/alr48/cheri/build_sdk.sh") KDEPlatformFileDialogHelper::setDirectory QUrl("sftp://server/home/alr48/cheri/build_sdk.sh") KDEPlatformFileDialogHelper::selectFile QUrl("file:///home/alex/build_sdk.sh") KDEPlatformFileDialogHelper::setDirectory QUrl("file:///home/alex/)
The final setDirectory() call is actually a call to
setDirectory(options->initialDirectory()) which was set in selectFile().
We now depend on Qt 5.9 so we can remove this code without a check for
version >= 5.7.1.
BUG: 374913