Fixed warning when loading themes contained inside a folder.

svn-id: r34763
This commit is contained in:
Vicent Marti 2008-10-09 18:51:26 +00:00
parent c3b1e34163
commit f2f25aa840

View file

@ -534,13 +534,16 @@ bool ThemeEngine::loadThemeXML(Common::String themeName) {
int parseCount = 0;
bool failed = false;
FSNode node(themeName);
if (!node.exists() || !node.isReadable())
return false;
#ifdef USE_ZLIB
Common::ZipArchive zipFile(themeName.c_str());
if (node.getPath().hasSuffix(".zip") && !node.isDirectory()) {
Common::ZipArchive zipFile(node);
Common::ArchiveMemberList zipContents;
if (zipFile.isOpen() && zipFile.listMembers(zipContents)) {
// for (uint i = 0; i < zipContents.size(); ++i) {
for (Common::ArchiveMemberList::iterator za = zipContents.begin(); za != zipContents.end(); ++za) {
if (!failed && matchString((*za)->getName().c_str(), "*.stx")) {
if (parser()->loadStream((*za)->open()) == false) {
@ -568,10 +571,12 @@ bool ThemeEngine::loadThemeXML(Common::String themeName) {
}
}
} else {
warning("Failed to open Zip archive '%s'.\n", themeName.c_str());
return false;
}
} else {
#endif
FSNode node(themeName);
if (node.exists() && node.isReadable() && node.isDirectory()) {
if (node.isDirectory()) {
FSList fslist;
if (!node.getChildren(fslist, FSNode::kListFilesOnly))
return false;