[Scummvm-git-logs] scummvm master -> c42dfbc4968ff2cdc7ad1ed316164d4cab20b550

criezy criezy at scummvm.org
Sun Sep 18 06:56:10 CEST 2016


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
33d1c55866 BACKENDS: Ignore timestamps for inexistent files in DefaultSaveFileManager
c42dfbc496 BACKEND: When removing a save files also remove entry from timestamps file


Commit: 33d1c558663f0b7ed5eafec999c506a55307ff27
    https://github.com/scummvm/scummvm/commit/33d1c558663f0b7ed5eafec999c506a55307ff27
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2016-09-18T05:31:29+01:00

Commit Message:
BACKENDS: Ignore timestamps for inexistent files in DefaultSaveFileManager

This fixes a bug in the synchronisation of the save files to the cloud when
the timestamps file contains entries for files that do no longer exist. In such
a case the synchronisation would fail.

Changed paths:
    backends/saves/default/default-saves.cpp



diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index 8a7fba4..72d65df 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -330,7 +330,8 @@ Common::HashMap<Common::String, uint32> DefaultSaveFileManager::loadTimestamps()
 		//parse timestamp
 		uint32 timestamp = buffer.asUint64();
 		if (buffer == "" || timestamp == 0) break;
-		timestamps[filename] = timestamp;
+		if (timestamps.contains(filename))
+			timestamps[filename] = timestamp;
 	}
 
 	delete file;


Commit: c42dfbc4968ff2cdc7ad1ed316164d4cab20b550
    https://github.com/scummvm/scummvm/commit/c42dfbc4968ff2cdc7ad1ed316164d4cab20b550
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2016-09-18T05:51:57+01:00

Commit Message:
BACKEND: When removing a save files also remove entry from timestamps file

Changed paths:
    backends/saves/default/default-saves.cpp



diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index 72d65df..a958974 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -181,6 +181,16 @@ bool DefaultSaveFileManager::removeSavefile(const Common::String &filename) {
 	assureCached(getSavePath());
 	if (getError().getCode() != Common::kNoError)
 		return false;
+	
+#ifdef USE_LIBCURL
+	// Update file's timestamp
+	Common::HashMap<Common::String, uint32> timestamps = loadTimestamps();
+	Common::HashMap<Common::String, uint32>::iterator it = timestamps.find(filename);
+	if (it != timestamps.end()) {
+		timestamps.erase(it);
+		saveTimestamps(timestamps);
+	}
+#endif
 
 	// Obtain node if exists.
 	SaveFileCache::const_iterator file = _saveFileCache.find(filename);





More information about the Scummvm-git-logs mailing list