Skip to content

[KDEPlatformFileDialog] Don't do stat if baseUrl didn't change

Kai Uwe Broulik requested to merge work/kbroulik/filedialog-double-stat into master

Qt might call setDirectory twice on dialog initialization, the second one coming from restoreFromSettings. This would needlessly trigger another StatJob if the URL didn't change.


Opened a file on a remote location (sftp) in KWrite, then hit "Open", it would open the file dialog in the location where the currently viewed file is located.

Before it would stat the sftp location twice in a row here. Now it's only once. Noticeably speeds up opening the file dialog for me in this scenario.

Especially since the second StatJob for some reason takes magnitudes longer than the first one (roughly ~800ms vs ~20ms).

(This could go into stable?)

Also, should this get ported to KIO::statDetails(directory, KIO::StatJob::SourceSide, KIO::StatBasic) since we only need to know if it's a dir?

@dfaure @ahmadsamir

Edited by Kai Uwe Broulik

Merge request reports