Ignore the difference between "\" and "/" in "recent" and "remove from recent".

This commit is contained in:
shenweip 2013-11-18 23:42:38 +08:00
parent 3b40705197
commit 09636da4ba
2 changed files with 3 additions and 3 deletions

View File

@ -554,7 +554,7 @@ void Config::Save() {
void Config::AddRecent(const std::string &file) {
for (auto str = recentIsos.begin(); str != recentIsos.end(); str++) {
if (*str == file) {
if (!strcmpIgnore(*str, file, "\\", "/")) {
recentIsos.erase(str);
recentIsos.insert(recentIsos.begin(), file);
if ((int)recentIsos.size() > iMaxRecent)

View File

@ -211,7 +211,7 @@ UI::EventReturn GameScreen::OnCreateShortcut(UI::EventParams &e) {
bool GameScreen::isRecentGame(std::string gamePath) {
for (auto it = g_Config.recentIsos.begin(); it != g_Config.recentIsos.end(); ++it) {
if (!strcmp((*it).c_str(),gamePath.c_str()))
if (!strcmpIgnore((*it).c_str(), gamePath_.c_str(), "\\","/"))
return true;
}
return false;
@ -219,7 +219,7 @@ bool GameScreen::isRecentGame(std::string gamePath) {
UI::EventReturn GameScreen::OnRemoveFromRecent(UI::EventParams &e) {
for (auto it = g_Config.recentIsos.begin(); it != g_Config.recentIsos.end(); ++it) {
if (!strcmp((*it).c_str(),gamePath_.c_str())) {
if (!strcmpIgnore((*it).c_str(), gamePath_.c_str(), "\\","/")) {
g_Config.recentIsos.erase(it);
screenManager()->switchScreen(new MainScreen());
return UI::EVENT_DONE;