From 6b639c6b214534c0e1c49b5a37a658948b086760 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Fri, 21 Sep 2007 05:27:33 +0000 Subject: Rename file removal functions, to avoid conflicts. Add save game path, when removing files via SaveFileManager. svn-id: r29001 --- backends/saves/default/default-saves.cpp | 7 +++++-- common/file.cpp | 6 +++--- common/file.h | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index 702b404434..c32edd0f7a 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -229,9 +229,12 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const char *filename) } bool DefaultSaveFileManager::removeSavefile(const char *filename) { + char buf[256]; + join_paths(filename, getSavePath(), buf, sizeof(buf)); + Common::File file; - FilesystemNode savePath(filename); - return file.remove(savePath); + FilesystemNode savePath((const char *)buf); + return file.removeFile(savePath); } #endif // !defined(DISABLE_DEFAULT_SAVEFILEMANAGER) diff --git a/common/file.cpp b/common/file.cpp index cdf8d5e13e..f7e4177e56 100644 --- a/common/file.cpp +++ b/common/file.cpp @@ -409,7 +409,7 @@ bool File::open(const FilesystemNode &node, AccessMode mode) { return true; } -bool File::remove(const String &filename){ +bool File::removeFile(const String &filename){ if (remove(filename.c_str()) != 0) { if (errno == EACCES) { //TODO: read-only file @@ -424,8 +424,8 @@ bool File::remove(const String &filename){ } } -bool File::remove(const FilesystemNode &node){ - if (remove(node.getPath()) != 0) { +bool File::removeFile(const FilesystemNode &node){ + if (remove(node.getPath().c_str()) != 0) { if (errno == EACCES) { //TODO: read-only file } diff --git a/common/file.h b/common/file.h index 4bec6605e7..d966d95f2d 100644 --- a/common/file.h +++ b/common/file.h @@ -85,8 +85,8 @@ public: virtual void close(); - virtual bool remove(const String &filename); - virtual bool remove(const FilesystemNode &node); + virtual bool removeFile(const String &filename); + virtual bool removeFile(const FilesystemNode &node); /** * Checks if the object opened a file successfully. -- cgit v1.2.3