From 0a4da48978457281191b37282fd7c2e7fe641e69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 10 Jul 2021 11:54:03 +0200 Subject: [PATCH] PathBrowser: Load all types of path asynchronously. Helps with slow scoped storage listings :/ --- Common/File/PathBrowser.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/Common/File/PathBrowser.cpp b/Common/File/PathBrowser.cpp index 26cfd64ef5..f7f426544a 100644 --- a/Common/File/PathBrowser.cpp +++ b/Common/File/PathBrowser.cpp @@ -128,13 +128,6 @@ void PathBrowser::HandlePath() { return; } - if (path_.Type() != PathType::HTTP) { - if (pendingActive_) - ResetPending(); - ready_ = true; - return; - } - std::lock_guard guard(pendingLock_); ready_ = false; pendingActive_ = true; @@ -163,6 +156,12 @@ void PathBrowser::HandlePath() { results.clear(); success = LoadRemoteFileList(lastPath, &pendingCancel_, results); guard.lock(); + } else { + guard.unlock(); + results.clear(); + File::GetFilesInDir(lastPath, &results, nullptr); + success = true; + guard.lock(); } if (pendingPath_ == lastPath) { @@ -214,12 +213,7 @@ bool PathBrowser::GetListing(std::vector &fileInfo, const char * guard.lock(); } - if (path_.Type() == PathType::HTTP) { - fileInfo = ApplyFilter(pendingFiles_, filter); - return true; - } - - File::GetFilesInDir(path_, &fileInfo, filter); + fileInfo = ApplyFilter(pendingFiles_, filter); return true; }