[Scummvm-cvs-logs] CVS: scummvm/common config-manager.cpp,1.40,1.41 config-manager.h,1.26,1.27
Chris Apers
chrilith at users.sourceforge.net
Sat Oct 8 12:11:13 CEST 2005
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29206
Modified Files:
config-manager.cpp config-manager.h
Log Message:
PalmOS:
- fix crash trying to use emptyString
- debug option
Index: config-manager.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/config-manager.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- config-manager.cpp 3 Sep 2005 16:08:27 -0000 1.40
+++ config-manager.cpp 8 Oct 2005 19:10:05 -0000 1.41
@@ -62,7 +62,7 @@
namespace Common {
-#ifndef PALMOS_ARM
+#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG))
const String ConfigManager::kApplicationDomain("scummvm");
const String ConfigManager::kTransientDomain("__TRANSIENT");
@@ -112,6 +112,7 @@
strcpy(configFile, DEFAULT_CONFIG_FILE);
#endif
#endif
+
loadConfigFile(configFile);
}
@@ -205,7 +206,7 @@
String key = rtrim(t);
String value = ltrim(p + 1);
set(key, value, domain);
-
+//printf("key : %s | %s\n");
// Store comment
if (_globalDomains.contains(domain)) {
_globalDomains[domain].setKVComment(key, comment);
@@ -356,7 +357,6 @@
// 3) All global domains
// 4) The defaults
-
if ((domain.isEmpty() || domain == kTransientDomain) && _transientDomain.contains(key))
return _transientDomain[key];
@@ -513,7 +513,11 @@
const String &ConfigManager::Domain::get(const String &key) const {
Node *node = findNode(_root, key);
+#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG))
return node ? node->_value : String::emptyString;
+#else
+ return node ? node->_value : ConfMan._emptyString;
+#endif
}
void ConfigManager::Domain::setDomainComment(const String &comment) {
Index: config-manager.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/config-manager.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- config-manager.h 3 Sep 2005 16:08:27 -0000 1.26
+++ config-manager.h 8 Oct 2005 19:10:05 -0000 1.27
@@ -67,7 +67,7 @@
typedef Map<String, Domain, IgnoreCaseComparator> DomainMap;
-#ifndef PALMOS_ARM
+#if !(defined(PALMOS_ARM) || defined(PALMOS_DEBUG))
/** The name of the application domain (normally 'scummvm'). */
static const String kApplicationDomain;
@@ -76,6 +76,8 @@
#else
static const char *kApplicationDomain;
static const char *kTransientDomain;
+
+ const String _emptyString;
#endif
void loadDefaultConfigFile();
More information about the Scummvm-git-logs
mailing list