aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti2008-09-30 17:21:55 +0000
committerVicent Marti2008-09-30 17:21:55 +0000
commit1380e4f7e70e712ad7984c5b5e8b070ab954987c (patch)
treeb220cbb2cd65d10ca8375b3a1fa3e077dcad76f2
parente290a3b6f3cf2fd1b686230126a8a27451cabdff (diff)
downloadscummvm-rg350-1380e4f7e70e712ad7984c5b5e8b070ab954987c.tar.gz
scummvm-rg350-1380e4f7e70e712ad7984c5b5e8b070ab954987c.tar.bz2
scummvm-rg350-1380e4f7e70e712ad7984c5b5e8b070ab954987c.zip
- Removed unneeded calls to addDefaultDir() when loading themes.
- Removed unneeded depth-browsing on the theme browser. svn-id: r34714
-rw-r--r--gui/theme.cpp10
-rw-r--r--gui/themebrowser.cpp12
-rw-r--r--gui/themebrowser.h2
3 files changed, 13 insertions, 11 deletions
diff --git a/gui/theme.cpp b/gui/theme.cpp
index 8c27d27417..cf77441267 100644
--- a/gui/theme.cpp
+++ b/gui/theme.cpp
@@ -134,6 +134,8 @@ bool Theme::themeConfigUseable(const Common::FilesystemNode &node, Common::Strin
Common::String stxHeader;
bool foundHeader = false;
+// Not needed atm, using FSNodes.
+/*
if (ConfMan.hasKey("themepath"))
Common::File::addDefaultDirectory(ConfMan.get("themepath"));
@@ -143,10 +145,11 @@ bool Theme::themeConfigUseable(const Common::FilesystemNode &node, Common::Strin
if (ConfMan.hasKey("extrapath"))
Common::File::addDefaultDirectoryRecursive(ConfMan.get("extrapath"));
+*/
+
+ if (node.getName().hasSuffix(".zip")) {
- if (node.getName().hasSuffix(".zip")) {
#ifdef USE_ZLIB
-
Common::ZipArchive zipArchive(node.getPath().c_str());
if (zipArchive.hasFile("THEMERC")) {
Common::FilePtr stream(zipArchive.openFile("THEMERC"));
@@ -157,7 +160,8 @@ bool Theme::themeConfigUseable(const Common::FilesystemNode &node, Common::Strin
}
#else
return false;
-#endif
+#endif
+
} else if (node.isDirectory()) {
Common::FilesystemNode headerfile = node.getChild("THEMERC");
if (!headerfile.exists() || !headerfile.isReadable() || headerfile.isDirectory())
diff --git a/gui/themebrowser.cpp b/gui/themebrowser.cpp
index c935f04143..5d8c1e3512 100644
--- a/gui/themebrowser.cpp
+++ b/gui/themebrowser.cpp
@@ -89,7 +89,7 @@ void ThemeBrowser::handleCommand(CommandSender *sender, uint32 cmd, uint32 data)
void ThemeBrowser::updateListing() {
_themes.clear();
- // classic is always build in
+ // classic is always built-in
Entry th;
th.name = "ScummVM Classic Theme (Builtin Version)";
th.file = "builtin";
@@ -100,7 +100,7 @@ void ThemeBrowser::updateListing() {
// files in other places are ignored in this dialog
// TODO: let the user browse the complete FS too/only the FS?
if (ConfMan.hasKey("themepath"))
- addDir(_themes, ConfMan.get("themepath"), 0);
+ addDir(_themes, ConfMan.get("themepath"));
#ifdef DATA_PATH
addDir(_themes, DATA_PATH);
@@ -112,7 +112,7 @@ void ThemeBrowser::updateListing() {
char buf[256];
if (CFURLGetFileSystemRepresentation(resourceUrl, true, (UInt8 *)buf, 256)) {
Common::String resourcePath = buf;
- addDir(_themes, resourcePath, 0);
+ addDir(_themes, resourcePath);
}
CFRelease(resourceUrl);
}
@@ -121,7 +121,7 @@ void ThemeBrowser::updateListing() {
if (ConfMan.hasKey("extrapath"))
addDir(_themes, ConfMan.get("extrapath"));
- addDir(_themes, ".", 0);
+ addDir(_themes, ".");
// Populate the ListWidget
Common::StringList list;
@@ -136,9 +136,7 @@ void ThemeBrowser::updateListing() {
draw();
}
-void ThemeBrowser::addDir(ThList &list, const Common::String &dir, int level) {
- if (level < 0)
- return;
+void ThemeBrowser::addDir(ThList &list, const Common::String &dir) {
Common::FilesystemNode node(dir);
diff --git a/gui/themebrowser.h b/gui/themebrowser.h
index c3a46aa3b0..e47c3aac37 100644
--- a/gui/themebrowser.h
+++ b/gui/themebrowser.h
@@ -56,7 +56,7 @@ private:
void updateListing();
- void addDir(ThList &list, const Common::String &dir, int level = 4);
+ void addDir(ThList &list, const Common::String &dir);
bool isTheme(const Common::FilesystemNode &node, Entry &out);
};