[Scummvm-cvs-logs] SF.net SVN: scummvm: [29001] scummvm/trunk
Kirben at users.sourceforge.net
Kirben at users.sourceforge.net
Fri Sep 21 07:27:33 CEST 2007
Revision: 29001
http://scummvm.svn.sourceforge.net/scummvm/?rev=29001&view=rev
Author: Kirben
Date: 2007-09-20 22:27:33 -0700 (Thu, 20 Sep 2007)
Log Message:
-----------
Rename file removal functions, to avoid conflicts. Add save game path, when removing files via SaveFileManager.
Modified Paths:
--------------
scummvm/trunk/backends/saves/default/default-saves.cpp
scummvm/trunk/common/file.cpp
scummvm/trunk/common/file.h
Modified: scummvm/trunk/backends/saves/default/default-saves.cpp
===================================================================
--- scummvm/trunk/backends/saves/default/default-saves.cpp 2007-09-21 01:35:07 UTC (rev 29000)
+++ scummvm/trunk/backends/saves/default/default-saves.cpp 2007-09-21 05:27:33 UTC (rev 29001)
@@ -229,9 +229,12 @@
}
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)
Modified: scummvm/trunk/common/file.cpp
===================================================================
--- scummvm/trunk/common/file.cpp 2007-09-21 01:35:07 UTC (rev 29000)
+++ scummvm/trunk/common/file.cpp 2007-09-21 05:27:33 UTC (rev 29001)
@@ -409,7 +409,7 @@
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 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
}
Modified: scummvm/trunk/common/file.h
===================================================================
--- scummvm/trunk/common/file.h 2007-09-21 01:35:07 UTC (rev 29000)
+++ scummvm/trunk/common/file.h 2007-09-21 05:27:33 UTC (rev 29001)
@@ -85,8 +85,8 @@
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.
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