mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-11 09:40:17 +00:00
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;
|
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
|
// filehelper
|
||||||
bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _pFilename, std::string* _pExtension);
|
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 BuildCompleteFilename(std::string& _CompleteFilename, const std::string& _Path, const std::string& _Filename);
|
||||||
|
void NormalizeDirSep(std::string* str);
|
||||||
|
|
||||||
#endif // _STRINGUTIL_H_
|
#endif // _STRINGUTIL_H_
|
||||||
|
@ -384,10 +384,24 @@ void CGameListCtrl::ScanForISOs()
|
|||||||
for (u32 j = 0; j < FST_Temp.children.size(); j++)
|
for (u32 j = 0; j < FST_Temp.children.size(); j++)
|
||||||
{
|
{
|
||||||
if (FST_Temp.children.at(j).isDirectory)
|
if (FST_Temp.children.at(j).isDirectory)
|
||||||
|
{
|
||||||
|
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());
|
Directories.push_back(FST_Temp.children.at(j).physicalName.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CFileSearch::XStringVector Extensions;
|
CFileSearch::XStringVector Extensions;
|
||||||
Extensions.push_back("*.iso");
|
Extensions.push_back("*.iso");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user