When searching iso directories subfolders, do not include folders multiple times
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2892 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
17d54d9771
commit
956b06700d
|
@ -449,3 +449,14 @@ std::string ThS(int Integer, bool Unsigned)
|
|||
}
|
||||
return sbuf;
|
||||
}
|
||||
|
||||
void NormalizeDirSep(std::string* str)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
int i;
|
||||
while ((i = (int)str->find_first_of('\\')) >= 0)
|
||||
{
|
||||
str->replace(i, 1, DIR_SEP);
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -73,6 +73,6 @@ int ChooseStringFrom(const char* str, const char* * items);
|
|||
// filehelper
|
||||
bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _pFilename, std::string* _pExtension);
|
||||
void BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _Path, const std::string& _Filename);
|
||||
|
||||
void NormalizeDirSep(std::string* str);
|
||||
|
||||
#endif // _STRINGUTIL_H_
|
||||
|
|
|
@ -384,7 +384,21 @@ void CGameListCtrl::ScanForISOs()
|
|||
for (u32 j = 0; j < FST_Temp.children.size(); j++)
|
||||
{
|
||||
if (FST_Temp.children.at(j).isDirectory)
|
||||
Directories.push_back(FST_Temp.children.at(j).physicalName.c_str());
|
||||
{
|
||||
bool duplicate = false;
|
||||
NormalizeDirSep(&(FST_Temp.children.at(j).physicalName));
|
||||
for (u32 k = 0; k < Directories.size(); k++)
|
||||
{
|
||||
NormalizeDirSep(&Directories.at(k));
|
||||
if (strcmp(Directories.at(k).c_str(), FST_Temp.children.at(j).physicalName.c_str()) == 0)
|
||||
{
|
||||
duplicate = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!duplicate)
|
||||
Directories.push_back(FST_Temp.children.at(j).physicalName.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue