mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-19 09:19:05 +02:00
Path code cleanup, move some UI code (#21037)
* Move a bunch of path logic into Core/Util/PathUtil.cpp/h . * Move GameImageView out from SaveDataScreen * More cleanup, add a translation string
This commit is contained in:
1 parent
3116eba395
commit
b8fced5b41
72 files changed
+416
-330
No files matched your search
@@ -204,31 +204,6 @@ void PathBrowser::ResetPending() {
|
||||
pendingPath_.clear();
|
||||
}
|
||||
|
||||
std::string PathBrowser::GetFriendlyPath() const {
|
||||
// Show relative to memstick root if there.
|
||||
if (path_.StartsWith(aliasMatch_)) {
|
||||
std::string p;
|
||||
if (aliasMatch_.ComputePathTo(path_, p)) {
|
||||
return aliasDisplay_ + p;
|
||||
}
|
||||
std::string str = path_.ToString();
|
||||
if (aliasMatch_.size() < str.length()) {
|
||||
return aliasDisplay_ + str.substr(aliasMatch_.size());
|
||||
} else {
|
||||
return aliasDisplay_;
|
||||
}
|
||||
}
|
||||
|
||||
std::string str = path_.ToString();
|
||||
#if !PPSSPP_PLATFORM(ANDROID) && (PPSSPP_PLATFORM(LINUX) || PPSSPP_PLATFORM(MAC))
|
||||
char *home = getenv("HOME");
|
||||
if (home != nullptr && !strncmp(str.c_str(), home, strlen(home))) {
|
||||
return std::string("~") + str.substr(strlen(home));
|
||||
}
|
||||
#endif
|
||||
return path_.ToVisualString();
|
||||
}
|
||||
|
||||
bool PathBrowser::GetListing(std::vector<File::FileInfo> &fileInfo, const char *extensionFilter, bool *cancel) {
|
||||
std::unique_lock<std::mutex> guard(pendingLock_);
|
||||
while (!IsListingReady() && (!cancel || !*cancel)) {
|
||||
|
||||
Reference in new issue
Block a user