diff options
Diffstat (limited to 'backends/saves/default/default-saves.cpp')
-rw-r--r-- | backends/saves/default/default-saves.cpp | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index dc5e8adca7..0cfd265890 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -28,7 +28,6 @@ #include "common/savefile.h" #include "common/util.h" #include "common/fs.h" -#include "common/file.h" #include "common/config-manager.h" #include "backends/saves/default/default-saves.h" #include "backends/saves/compressed/compressed-saves.h" @@ -37,7 +36,7 @@ #include <string.h> #include <errno.h> -#if defined(UNIX) || defined(__SYMBIAN32__) +#if defined(UNIX) #include <sys/stat.h> #endif @@ -47,8 +46,6 @@ #else #define DEFAULT_SAVE_PATH ".scummvm" #endif -#elif defined(__SYMBIAN32__) -#define DEFAULT_SAVE_PATH "Savegames" #endif DefaultSaveFileManager::DefaultSaveFileManager() { @@ -64,10 +61,6 @@ DefaultSaveFileManager::DefaultSaveFileManager() { savePath += "/" DEFAULT_SAVE_PATH; ConfMan.registerDefault("savepath", savePath); } -#elif defined(__SYMBIAN32__) - savePath = Symbian::GetExecutablePath(); - savePath += DEFAULT_SAVE_PATH "\\"; - ConfMan.registerDefault("savepath", savePath); #endif #endif // #ifdef DEFAULT_SAVE_PATH } @@ -78,13 +71,13 @@ DefaultSaveFileManager::DefaultSaveFileManager(const Common::String &defaultSave Common::StringList DefaultSaveFileManager::listSavefiles(const char *pattern) { - FilesystemNode savePath(getSavePath()); - FSList savefiles; + Common::FilesystemNode savePath(getSavePath()); + Common::FSList savefiles; Common::StringList results; Common::String search(pattern); if (savePath.lookupFile(savefiles, search, false, true, 0)) { - for (FSList::const_iterator file = savefiles.begin(); file != savefiles.end(); ++file) { + for (Common::FSList::const_iterator file = savefiles.begin(); file != savefiles.end(); ++file) { results.push_back(file->getName()); } } @@ -92,11 +85,11 @@ Common::StringList DefaultSaveFileManager::listSavefiles(const char *pattern) { return results; } -void DefaultSaveFileManager::checkPath(const FilesystemNode &dir) { +void DefaultSaveFileManager::checkPath(const Common::FilesystemNode &dir) { const Common::String path = dir.getPath(); clearError(); -#if defined(UNIX) || defined(__SYMBIAN32__) +#if defined(UNIX) struct stat sb; // Check whether the dir exists @@ -108,11 +101,9 @@ void DefaultSaveFileManager::checkPath(const FilesystemNode &dir) { case EACCES: setError(SFM_DIR_ACCESS, "Search or write permission denied: "+path); break; -#if !defined(__SYMBIAN32__) case ELOOP: setError(SFM_DIR_LOOP, "Too many symbolic links encountered while traversing the path: "+path); break; -#endif case ENAMETOOLONG: setError(SFM_DIR_NAMETOOLONG, "The path name is too long: "+path); break; @@ -130,11 +121,9 @@ void DefaultSaveFileManager::checkPath(const FilesystemNode &dir) { case EMLINK: setError(SFM_DIR_LINKMAX, "The link count of the parent directory would exceed {LINK_MAX}: "+path); break; -#if !defined(__SYMBIAN32__) case ELOOP: setError(SFM_DIR_LOOP, "Too many symbolic links encountered while traversing the path: "+path); break; -#endif case ENAMETOOLONG: setError(SFM_DIR_NAMETOOLONG, "The path name is too long: "+path); break; @@ -173,11 +162,11 @@ void DefaultSaveFileManager::checkPath(const FilesystemNode &dir) { Common::InSaveFile *DefaultSaveFileManager::openForLoading(const char *filename) { // Ensure that the savepath is valid. If not, generate an appropriate error. - FilesystemNode savePath(getSavePath()); + Common::FilesystemNode savePath(getSavePath()); checkPath(savePath); if (getError() == SFM_NO_ERROR) { - FilesystemNode file = savePath.getChild(filename); + Common::FilesystemNode file = savePath.getChild(filename); // Open the file for reading Common::SeekableReadStream *sf = file.openForReading(); @@ -190,11 +179,11 @@ Common::InSaveFile *DefaultSaveFileManager::openForLoading(const char *filename) Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const char *filename) { // Ensure that the savepath is valid. If not, generate an appropriate error. - FilesystemNode savePath(getSavePath()); + Common::FilesystemNode savePath(getSavePath()); checkPath(savePath); if (getError() == SFM_NO_ERROR) { - FilesystemNode file = savePath.getChild(filename); + Common::FilesystemNode file = savePath.getChild(filename); // Open the file for saving Common::WriteStream *sf = file.openForWriting(); @@ -208,8 +197,8 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const char *filename) bool DefaultSaveFileManager::removeSavefile(const char *filename) { clearError(); - FilesystemNode savePath(getSavePath()); - FilesystemNode file = savePath.getChild(filename); + Common::FilesystemNode savePath(getSavePath()); + Common::FilesystemNode file = savePath.getChild(filename); // TODO: Add new method FilesystemNode::remove() if (remove(file.getPath().c_str()) != 0) { |