Fix QFileDialog::selectUrl() setting initial directory

Authored by muhlenpfordt on Jun 29 2018, 10:37 AM.

Description

Fix QFileDialog::selectUrl() setting initial directory

Summary:
In D4193 setting the initial directory to the given URL when using
QFileDialog::selectUrl() was removed.

  • This causes FileOpen to not start in the current directory but in Gwenviews initial or last set path. In addition, due to adding StripTrailingSlash, D9886 caused the file dialog to select the last subfolder as a file instead of entering it. Both problems can be fixed by using QFileDialog::setDirectoryUrl() instead of QFileDialog::selectUrl().
  • The first problem also occurs in FileSave As. Until this issue is fixed in the libraries an additional QFileDialog::setDirectoryUrl() is added as workaround.

FIXED-IN: 18.04.3

Test Plan:

  1. Open Gwenview
  2. Use FileOpen or FileSave As
  3. The file dialog should start in the current directory

Reviewers: Gwenview, rkflx

Reviewed By: Gwenview, rkflx

Subscribers: rkflx

Differential Revision: https://phabricator.kde.org/D13795

Details