[Scummvm-cvs-logs] SF.net SVN: scummvm: [26021] scummvm/trunk/gui/options.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Mar 8 18:05:58 CET 2007


Revision: 26021
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26021&view=rev
Author:   fingolfin
Date:     2007-03-08 09:05:58 -0800 (Thu, 08 Mar 2007)

Log Message:
-----------
Get rid of getcwd abuse here, and unify the way savepath, extrapath and themepath are handled

Modified Paths:
--------------
    scummvm/trunk/gui/options.cpp

Modified: scummvm/trunk/gui/options.cpp
===================================================================
--- scummvm/trunk/gui/options.cpp	2007-03-08 16:57:14 UTC (rev 26020)
+++ scummvm/trunk/gui/options.cpp	2007-03-08 17:05:58 UTC (rev 26021)
@@ -38,28 +38,8 @@
 #include "sound/mididrv.h"
 #include "sound/mixer.h"
 
-#if (!( defined(PALMOS_MODE) || defined(__DC__) || defined(__GP32__) || defined(__amigaos4__) ) && !defined(_MSC_VER) && !defined(__DS__))
-#include <sys/param.h>
-#include <unistd.h>
-#endif
-
-#if !(defined(MAXPATHLEN))
-#ifndef PALMOS_MODE
-#define MAXPATHLEN 1024
-#else
-#define MAXPATHLEN 256
-#endif
-#endif
-
 namespace GUI {
 
-// TODO - allow changing options for:
-// - the save path (use _dirBrowser!)
-// - music & graphics driver (but see also the comments on EditGameDialog
-//   for some techincal difficulties with this)
-// - default volumes (sfx/speech/music)
-// - aspect ratio, language, platform, debug mode/level, cd drive, joystick, multi midi, native mt32
-
 enum {
 	kMidiGainChanged		= 'mgch',
 	kMusicVolumeChanged		= 'muvc',
@@ -747,13 +727,10 @@
 	Common::String themePath(ConfMan.get("themepath", _domain));
 	Common::String extraPath(ConfMan.get("extrapath", _domain));
 
-	if (!savePath.empty()) {
-		_savePath->setLabel(savePath);
+	if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) {
+		_savePath->setLabel("None");
 	} else {
-		// Default to the current directory...
-		char buf[MAXPATHLEN];
-		getcwd(buf, sizeof(buf));
-		_savePath->setLabel(buf);
+		_savePath->setLabel(savePath);
 	}
 
 	if (themePath.empty() || !ConfMan.hasKey("themepath", _domain)) {
@@ -780,8 +757,9 @@
 
 void GlobalOptionsDialog::close() {
 	if (getResult()) {
-		// Savepath
-		ConfMan.set("savepath", _savePath->getLabel(), _domain);
+		String savePath(_savePath->getLabel());
+		if (!savePath.empty() && (savePath != "None"))
+			ConfMan.set("savepath", savePath, _domain);
 
 		String themePath(_themePath->getLabel());
 		if (!themePath.empty() && (themePath != "None"))


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