diff options
author | Max Horn | 2008-08-04 19:38:28 +0000 |
---|---|---|
committer | Max Horn | 2008-08-04 19:38:28 +0000 |
commit | 4f5479ee744ac6b419cdf7ec1e96fbf7c83d36ef (patch) | |
tree | eace9bc147f654a91700c8ab4e73f361379fa59b /backends/saves | |
parent | 99addb709cb4982725c685447774021ad2917e59 (diff) | |
download | scummvm-rg350-4f5479ee744ac6b419cdf7ec1e96fbf7c83d36ef.tar.gz scummvm-rg350-4f5479ee744ac6b419cdf7ec1e96fbf7c83d36ef.tar.bz2 scummvm-rg350-4f5479ee744ac6b419cdf7ec1e96fbf7c83d36ef.zip |
Pushed some port specific code from DefaultSaveFileManager out to port specific code in backends/platform/
svn-id: r33621
Diffstat (limited to 'backends/saves')
-rw-r--r-- | backends/saves/default/default-saves.cpp | 24 | ||||
-rw-r--r-- | backends/saves/default/default-saves.h | 1 |
2 files changed, 9 insertions, 16 deletions
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index bd72739f44..dc5e8adca7 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -41,10 +41,6 @@ #include <sys/stat.h> #endif -#ifdef IPHONE -#include "backends/platform/iphone/osys_iphone.h" -#endif - #ifdef UNIX #ifdef MACOSX #define DEFAULT_SAVE_PATH "Documents/ScummVM Savegames" @@ -53,8 +49,6 @@ #endif #elif defined(__SYMBIAN32__) #define DEFAULT_SAVE_PATH "Savegames" -#elif defined(PALMOS_MODE) -#define DEFAULT_SAVE_PATH "/PALM/Programs/ScummVM/Saved" #endif DefaultSaveFileManager::DefaultSaveFileManager() { @@ -62,27 +56,25 @@ DefaultSaveFileManager::DefaultSaveFileManager() { // TODO: Remove this code here, and instead leave setting the // default savepath to the ports using this class. #ifdef DEFAULT_SAVE_PATH - char savePath[MAXPATHLEN]; + Common::String savePath; #if defined(UNIX) && !defined(IPHONE) const char *home = getenv("HOME"); if (home && *home && strlen(home) < MAXPATHLEN) { - snprintf(savePath, MAXPATHLEN, "%s/%s", home, DEFAULT_SAVE_PATH); + savePath = home; + savePath += "/" DEFAULT_SAVE_PATH; ConfMan.registerDefault("savepath", savePath); } #elif defined(__SYMBIAN32__) - strcpy(savePath, Symbian::GetExecutablePath()); - strcat(savePath, DEFAULT_SAVE_PATH); - strcat(savePath, "\\"); + savePath = Symbian::GetExecutablePath(); + savePath += DEFAULT_SAVE_PATH "\\"; ConfMan.registerDefault("savepath", savePath); -#elif defined (IPHONE) - ConfMan.registerDefault("savepath", OSystem_IPHONE::getSavePath()); - -#elif defined(PALMOS_MODE) - ConfMan.registerDefault("savepath", DEFAULT_SAVE_PATH); #endif #endif // #ifdef DEFAULT_SAVE_PATH } +DefaultSaveFileManager::DefaultSaveFileManager(const Common::String &defaultSavepath) { + ConfMan.registerDefault("savepath", defaultSavepath); +} Common::StringList DefaultSaveFileManager::listSavefiles(const char *pattern) { diff --git a/backends/saves/default/default-saves.h b/backends/saves/default/default-saves.h index 0e98d0ea9e..97845c4623 100644 --- a/backends/saves/default/default-saves.h +++ b/backends/saves/default/default-saves.h @@ -35,6 +35,7 @@ class DefaultSaveFileManager : public Common::SaveFileManager { public: DefaultSaveFileManager(); + DefaultSaveFileManager(const Common::String &defaultSavepath); virtual Common::StringList listSavefiles(const char *pattern); virtual Common::InSaveFile *openForLoading(const char *filename); |