mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
PathBrowser: Load all types of path asynchronously. Helps with slow scoped storage listings :/
This commit is contained in:
parent
a0bae1855f
commit
0a4da48978
1 changed files with 7 additions and 13 deletions
|
@ -128,13 +128,6 @@ void PathBrowser::HandlePath() {
|
|||
return;
|
||||
}
|
||||
|
||||
if (path_.Type() != PathType::HTTP) {
|
||||
if (pendingActive_)
|
||||
ResetPending();
|
||||
ready_ = true;
|
||||
return;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> 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<File::FileInfo> &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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue