mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-10 21:16:24 +02:00
UI: Resolve symlinks when adding things to recent.
See #11131. This also normalizes paths, captialization, etc. as necessary.
This commit is contained in:
1 parent
1fdb1f785a
commit
048afb6d24
7 files changed
+52
-38
No files matched your search
+5
-18
@@ -354,31 +354,18 @@ bool GameScreen::isRecentGame(const std::string &gamePath) {
|
||||
if (g_Config.iMaxRecent <= 0)
|
||||
return false;
|
||||
|
||||
const std::string resolved = File::ResolvePath(gamePath);
|
||||
for (auto it = g_Config.recentIsos.begin(); it != g_Config.recentIsos.end(); ++it) {
|
||||
#ifdef _WIN32
|
||||
if (!strcmpIgnore((*it).c_str(), gamePath.c_str(), "\\","/"))
|
||||
#else
|
||||
if (!strcmp((*it).c_str(), gamePath.c_str()))
|
||||
#endif
|
||||
const std::string recent = File::ResolvePath(*it);
|
||||
if (resolved == recent)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
UI::EventReturn GameScreen::OnRemoveFromRecent(UI::EventParams &e) {
|
||||
if (g_Config.iMaxRecent <= 0)
|
||||
return UI::EVENT_DONE;
|
||||
for (auto it = g_Config.recentIsos.begin(); it != g_Config.recentIsos.end(); ++it) {
|
||||
#ifdef _WIN32
|
||||
if (!strcmpIgnore((*it).c_str(), gamePath_.c_str(), "\\","/")) {
|
||||
#else
|
||||
if (!strcmp((*it).c_str(), gamePath_.c_str())) {
|
||||
#endif
|
||||
g_Config.recentIsos.erase(it);
|
||||
screenManager()->switchScreen(new MainScreen());
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
}
|
||||
g_Config.RemoveRecent(gamePath_);
|
||||
screenManager()->switchScreen(new MainScreen());
|
||||
return UI::EVENT_DONE;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user