[Scummvm-cvs-logs] SF.net SVN: scummvm:[34714] scummvm/branches/gsoc2008-gui/gui
tanoku at users.sourceforge.net
tanoku at users.sourceforge.net
Tue Sep 30 19:22:02 CEST 2008
Revision: 34714
http://scummvm.svn.sourceforge.net/scummvm/?rev=34714&view=rev
Author: tanoku
Date: 2008-09-30 17:21:55 +0000 (Tue, 30 Sep 2008)
Log Message:
-----------
- Removed unneeded calls to addDefaultDir() when loading themes.
- Removed unneeded depth-browsing on the theme browser.
Modified Paths:
--------------
scummvm/branches/gsoc2008-gui/gui/theme.cpp
scummvm/branches/gsoc2008-gui/gui/themebrowser.cpp
scummvm/branches/gsoc2008-gui/gui/themebrowser.h
Modified: scummvm/branches/gsoc2008-gui/gui/theme.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/theme.cpp 2008-09-30 17:09:41 UTC (rev 34713)
+++ scummvm/branches/gsoc2008-gui/gui/theme.cpp 2008-09-30 17:21:55 UTC (rev 34714)
@@ -134,6 +134,8 @@
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 @@
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 @@
}
#else
return false;
-#endif
+#endif
+
} else if (node.isDirectory()) {
Common::FilesystemNode headerfile = node.getChild("THEMERC");
if (!headerfile.exists() || !headerfile.isReadable() || headerfile.isDirectory())
Modified: scummvm/branches/gsoc2008-gui/gui/themebrowser.cpp
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/themebrowser.cpp 2008-09-30 17:09:41 UTC (rev 34713)
+++ scummvm/branches/gsoc2008-gui/gui/themebrowser.cpp 2008-09-30 17:21:55 UTC (rev 34714)
@@ -89,7 +89,7 @@
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 @@
// 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 @@
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 @@
if (ConfMan.hasKey("extrapath"))
addDir(_themes, ConfMan.get("extrapath"));
- addDir(_themes, ".", 0);
+ addDir(_themes, ".");
// Populate the ListWidget
Common::StringList list;
@@ -136,9 +136,7 @@
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);
Modified: scummvm/branches/gsoc2008-gui/gui/themebrowser.h
===================================================================
--- scummvm/branches/gsoc2008-gui/gui/themebrowser.h 2008-09-30 17:09:41 UTC (rev 34713)
+++ scummvm/branches/gsoc2008-gui/gui/themebrowser.h 2008-09-30 17:21:55 UTC (rev 34714)
@@ -56,7 +56,7 @@
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);
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list