When adding filenames to recent list, convert slashes to /. See #9335
Note that this doesn't fix existing backslashes but solves it in the long run.
This commit is contained in:
parent
06cf449719
commit
31dd8fdc39
1 changed files with 10 additions and 4 deletions
|
@ -1110,20 +1110,26 @@ void Config::AddRecent(const std::string &file) {
|
||||||
if (iMaxRecent <= 0)
|
if (iMaxRecent <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
std::string filename = ReplaceAll(file, "\\", "/");
|
||||||
|
#else
|
||||||
|
std::string filename = file;
|
||||||
|
#endif
|
||||||
|
|
||||||
for (auto str = recentIsos.begin(); str != recentIsos.end(); ++str) {
|
for (auto str = recentIsos.begin(); str != recentIsos.end(); ++str) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (!strcmpIgnore((*str).c_str(), file.c_str(), "\\", "/")) {
|
if (!strcmpIgnore((*str).c_str(), filename.c_str(), "\\", "/")) {
|
||||||
#else
|
#else
|
||||||
if (!strcmp((*str).c_str(), file.c_str())) {
|
if (!strcmp((*str).c_str(), filename.c_str())) {
|
||||||
#endif
|
#endif
|
||||||
recentIsos.erase(str);
|
recentIsos.erase(str);
|
||||||
recentIsos.insert(recentIsos.begin(), file);
|
recentIsos.insert(recentIsos.begin(), filename);
|
||||||
if ((int)recentIsos.size() > iMaxRecent)
|
if ((int)recentIsos.size() > iMaxRecent)
|
||||||
recentIsos.resize(iMaxRecent);
|
recentIsos.resize(iMaxRecent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
recentIsos.insert(recentIsos.begin(), file);
|
recentIsos.insert(recentIsos.begin(), filename);
|
||||||
if ((int)recentIsos.size() > iMaxRecent)
|
if ((int)recentIsos.size() > iMaxRecent)
|
||||||
recentIsos.resize(iMaxRecent);
|
recentIsos.resize(iMaxRecent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue