Commit fffe10df authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

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

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.
parent 3a93cd53
Pipeline #141755 passed with stage
in 2 minutes and 29 seconds
......@@ -204,6 +204,11 @@ void KDEPlatformFileDialog::selectNameFilter(const QString &filter)
void KDEPlatformFileDialog::setDirectory(const QUrl &directory)
{
if (!directory.isLocalFile()) {
// Short-circuit: Avoid stat if the effective URL hasn't changed
if (directory == m_fileWidget->baseUrl()) {
return;
}
// Qt can not determine if the remote URL points to a file or a
// directory, that is why options()->initialDirectory() always returns
// the full URL.
......
Supports Markdown
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