More cleanup
svn-id: r26602
This commit is contained in:
parent
672ad9928a
commit
ff2ed4b0a9
1 changed files with 8 additions and 12 deletions
|
@ -254,6 +254,8 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p
|
||||||
IntMap filesSize;
|
IntMap filesSize;
|
||||||
IntMap allFiles;
|
IntMap allFiles;
|
||||||
|
|
||||||
|
File testFile;
|
||||||
|
|
||||||
String tstr;
|
String tstr;
|
||||||
|
|
||||||
uint i;
|
uint i;
|
||||||
|
@ -280,17 +282,15 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p
|
||||||
if (fslist != 0) {
|
if (fslist != 0) {
|
||||||
// Get the information of the existing files
|
// Get the information of the existing files
|
||||||
for (FSList::const_iterator file = fslist->begin(); file != fslist->end(); ++file) {
|
for (FSList::const_iterator file = fslist->begin(); file != fslist->end(); ++file) {
|
||||||
Common::File f;
|
|
||||||
|
|
||||||
if (file->isDirectory()) continue;
|
if (file->isDirectory()) continue;
|
||||||
tstr = file->name();
|
tstr = file->name();
|
||||||
tstr.toLowercase();
|
tstr.toLowercase();
|
||||||
|
|
||||||
// Strip the trailing dot
|
// Strip any trailing dot
|
||||||
if (tstr.lastChar() == '.')
|
if (tstr.lastChar() == '.')
|
||||||
tstr.deleteLastChar();
|
tstr.deleteLastChar();
|
||||||
|
|
||||||
allFiles[tstr] = 1;
|
allFiles[tstr] = true;
|
||||||
|
|
||||||
debug(3, "+ %s", tstr.c_str());
|
debug(3, "+ %s", tstr.c_str());
|
||||||
|
|
||||||
|
@ -302,15 +302,13 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p
|
||||||
|
|
||||||
debug(3, "> %s: %s", tstr.c_str(), md5str);
|
debug(3, "> %s: %s", tstr.c_str(), md5str);
|
||||||
|
|
||||||
if (f.open(file->path())) {
|
if (testFile.open(file->path())) {
|
||||||
filesSize[tstr] = (int32)f.size();
|
filesSize[tstr] = (int32)testFile.size();
|
||||||
f.close();
|
testFile.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Get the information of the requested files
|
// Get the information of the requested files
|
||||||
File testFile;
|
|
||||||
|
|
||||||
for (StringSet::const_iterator file = filesList.begin(); file != filesList.end(); ++file) {
|
for (StringSet::const_iterator file = filesList.begin(); file != filesList.end(); ++file) {
|
||||||
tstr = file->_key;
|
tstr = file->_key;
|
||||||
|
|
||||||
|
@ -425,8 +423,6 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p
|
||||||
|
|
||||||
// First we create list of files required for detection.
|
// First we create list of files required for detection.
|
||||||
// The filenames can be different than the MD5 based match ones.
|
// The filenames can be different than the MD5 based match ones.
|
||||||
File testFile;
|
|
||||||
|
|
||||||
for (; ptr->desc; ptr++) {
|
for (; ptr->desc; ptr++) {
|
||||||
filenames = ptr->filenames;
|
filenames = ptr->filenames;
|
||||||
for (; *filenames; filenames++) {
|
for (; *filenames; filenames++) {
|
||||||
|
@ -435,7 +431,7 @@ static ADGameDescList detectGame(const FSList *fslist, const Common::ADParams &p
|
||||||
|
|
||||||
if (!allFiles.contains(tstr)) {
|
if (!allFiles.contains(tstr)) {
|
||||||
if (testFile.open(tstr) || testFile.open(tstr + ".")) {
|
if (testFile.open(tstr) || testFile.open(tstr + ".")) {
|
||||||
allFiles[tstr] = 1;
|
allFiles[tstr] = true;
|
||||||
testFile.close();
|
testFile.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue