[Scummvm-cvs-logs] CVS: scummvm/common config-manager.cpp,1.13,1.14 config-manager.h,1.8,1.9

Max Horn fingolfin at users.sourceforge.net
Mon Nov 10 16:27:06 CET 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv26601

Modified Files:
	config-manager.cpp config-manager.h 
Log Message:
cleanup (merged the two base set() methods)

Index: config-manager.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/config-manager.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- config-manager.cpp	10 Nov 2003 23:17:11 -0000	1.13
+++ config-manager.cpp	11 Nov 2003 00:26:38 -0000	1.14
@@ -300,33 +300,30 @@
 #pragma mark -
 
 
-void ConfigManager::set(const String &key, const String &value) {
-	// Remove the transient domain value
-	_transientDomain.remove(key);
-
-	if (_activeDomain.isEmpty())
-		_globalDomains[kApplicationDomain][key] = value;
-	else
-		_gameDomains[_activeDomain][key] = value;
-}
-
 void ConfigManager::set(const String &key, const String &value, const String &dom) {
 	if (dom.isEmpty()) {
-		set(key, value);
-		return;
-	}
+		// Remove the transient domain value
+		_transientDomain.remove(key);
+	
+		if (_activeDomain.isEmpty())
+			_globalDomains[kApplicationDomain][key] = value;
+		else
+			_gameDomains[_activeDomain][key] = value;
 
-	if (dom == kTransientDomain)
-		_transientDomain[key] = value;
-	else {
-		if (_globalDomains.contains(dom)) {
-			_globalDomains[dom][key] = value;
-			if (_activeDomain.isEmpty() || !_gameDomains[_activeDomain].contains(key))
-				_transientDomain.remove(key);
-		} else {
-			_gameDomains[dom][key] = value;
-			if (dom == _activeDomain)
-				_transientDomain.remove(key);
+	} else {
+
+		if (dom == kTransientDomain)
+			_transientDomain[key] = value;
+		else {
+			if (_globalDomains.contains(dom)) {
+				_globalDomains[dom][key] = value;
+				if (_activeDomain.isEmpty() || !_gameDomains[_activeDomain].contains(key))
+					_transientDomain.remove(key);
+			} else {
+				_gameDomains[dom][key] = value;
+				if (dom == _activeDomain)
+					_transientDomain.remove(key);
+			}
 		}
 	}
 }

Index: config-manager.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/config-manager.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- config-manager.h	10 Nov 2003 23:17:11 -0000	1.8
+++ config-manager.h	11 Nov 2003 00:26:38 -0000	1.9
@@ -70,8 +70,7 @@
 	int					getInt(const String &key, const String &dom = String::emptyString) const;
 	bool				getBool(const String &key, const String &dom = String::emptyString) const;
 
-	void				set(const String &key, const String &value);
-	void				set(const String &key, const String &value, const String &dom);
+	void				set(const String &key, const String &value, const String &dom = String::emptyString);
 	void				set(const String &key, const char *value, const String &dom = String::emptyString);
 	void				set(const String &key, int value, const String &dom = String::emptyString);
 	void				set(const String &key, bool value, const String &dom = String::emptyString);





More information about the Scummvm-git-logs mailing list