aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2007-09-21 05:27:33 +0000
committerTravis Howell2007-09-21 05:27:33 +0000
commit6b639c6b214534c0e1c49b5a37a658948b086760 (patch)
tree1f077c241a47654d8160223ebf331027c12bc34e
parentbcbf127b390af57579d8e8ada15fdbebb53e68fa (diff)
downloadscummvm-rg350-6b639c6b214534c0e1c49b5a37a658948b086760.tar.gz
scummvm-rg350-6b639c6b214534c0e1c49b5a37a658948b086760.tar.bz2
scummvm-rg350-6b639c6b214534c0e1c49b5a37a658948b086760.zip
Rename file removal functions, to avoid conflicts. Add save game path, when removing files via SaveFileManager.
svn-id: r29001
-rw-r--r--backends/saves/default/default-saves.cpp7
-rw-r--r--common/file.cpp6
-rw-r--r--common/file.h4
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.