[Scummvm-cvs-logs] scummvm master -> a6e638de6e558a6d4f760c7c425d6df29f4090c9

eriktorbjorn eriktorbjorn at telia.com
Sun Aug 14 11:05:37 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a6e638de6e MAIN: Avoid adding the same extra path twice


Commit: a6e638de6e558a6d4f760c7c425d6df29f4090c9
    https://github.com/scummvm/scummvm/commit/a6e638de6e558a6d4f760c7c425d6df29f4090c9
Author: eriktorbjorn (eriktorbjorn at users.sourceforge.net)
Date: 2011-08-14T02:01:10-07:00

Commit Message:
MAIN: Avoid adding the same extra path twice

This doesn't make any practical difference, since the search
manager already guards against duplicate paths, but it does get rid
of a slightly confusing warning message when you have a global
extra path configured.

Changed paths:
    base/main.cpp



diff --git a/base/main.cpp b/base/main.cpp
index 780015d..a0792a9 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -186,9 +186,15 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
 	}
 
 	// If a second extrapath is specified on the app domain level, add that as well.
+	// However, since the default hasKey() and get() check the app domain level,
+	// verify that it's not already there before adding it. The search manager will
+	// check for that too, so this check is mostly to avoid a warning message.
 	if (ConfMan.hasKey("extrapath", Common::ConfigManager::kApplicationDomain)) {
-		dir = Common::FSNode(ConfMan.get("extrapath", Common::ConfigManager::kApplicationDomain));
-		SearchMan.addDirectory(dir.getPath(), dir);
+		Common::String extraPath = ConfMan.get("extrapath", Common::ConfigManager::kApplicationDomain);
+		if (!SearchMan.hasArchive(extraPath)) {
+			dir = Common::FSNode(extraPath);
+			SearchMan.addDirectory(dir.getPath(), dir);
+		}
 	}
 
 	// On creation the engine should have set up all debug levels so we can use






More information about the Scummvm-git-logs mailing list