From 473337effd7992940c0e84e5dc85062d03fa47c0 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 7 May 2011 15:49:57 +0200 Subject: GUI: Allow .zip files with case differing from ".zip" as theme files too. Formerly our code used "hasSuffix" to check for a ".zip" suffix. Since hasSuffix does a case-sensitive match that would not work, in case the file was called "scummmodern.ZIP" instead of "scummmodern.zip" for example. To fix that I am using a case-insensitive matchString instead now. --- gui/ThemeEngine.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'gui') diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 7fe40542c2..098cb8e0ac 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -391,7 +391,7 @@ bool ThemeEngine::init() { Common::FSNode node(_themeFile); if (node.isDirectory()) { _themeArchive = new Common::FSDirectory(node); - } else if (_themeFile.hasSuffix(".zip")) { + } else if (_themeFile.matchString("*.zip", true)) { // TODO: Also use "node" directly? // Look for the zip file via SearchMan Common::ArchiveMemberPtr member = SearchMan.getMember(_themeFile); @@ -1535,7 +1535,7 @@ bool ThemeEngine::themeConfigUsable(const Common::ArchiveMember &member, Common: Common::File stream; bool foundHeader = false; - if (member.getName().hasSuffix(".zip")) { + if (member.getName().matchString("*.zip", true)) { Common::Archive *zipArchive = Common::makeZipArchive(member.createReadStream()); if (zipArchive && zipArchive->hasFile("THEMERC")) { @@ -1557,7 +1557,7 @@ bool ThemeEngine::themeConfigUsable(const Common::FSNode &node, Common::String & Common::File stream; bool foundHeader = false; - if (node.getName().hasSuffix(".zip") && !node.isDirectory()) { + if (node.getName().matchString("*.zip", true) && !node.isDirectory()) { Common::Archive *zipArchive = Common::makeZipArchive(node); if (zipArchive && zipArchive->hasFile("THEMERC")) { // Open THEMERC from the ZIP file. @@ -1643,7 +1643,7 @@ void ThemeEngine::listUsableThemes(Common::Archive &archive, Common::ListgetPath().hasSuffix(".zip")) + if (!i->getPath().matchString("*.zip", true)) continue; td.name.clear(); @@ -1690,7 +1690,7 @@ void ThemeEngine::listUsableThemes(const Common::FSNode &node, Common::List