diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/module.mk | 9 | ||||
-rw-r--r-- | backends/saves/default/default-saves.cpp | 12 | ||||
-rw-r--r-- | backends/saves/savefile.cpp | 4 |
3 files changed, 16 insertions, 9 deletions
diff --git a/backends/module.mk b/backends/module.mk index 10dde0be8f..158f9a3b7c 100644 --- a/backends/module.mk +++ b/backends/module.mk @@ -19,6 +19,8 @@ MODULE_OBJS := \ saves/default/default-saves.o \ timer/default/default-timer.o +ifdef USE_CLOUD + ifdef USE_LIBCURL MODULE_OBJS += \ cloud/cloudicon.o \ @@ -52,7 +54,12 @@ MODULE_OBJS += \ cloud/onedrive/onedrivecreatedirectoryrequest.o \ cloud/onedrive/onedrivetokenrefresher.o \ cloud/onedrive/onedrivelistdirectoryrequest.o \ - cloud/onedrive/onedriveuploadrequest.o \ + cloud/onedrive/onedriveuploadrequest.o +endif +endif + +ifdef USE_LIBCURL +MODULE_OBJS += \ networking/curl/connectionmanager.o \ networking/curl/networkreadstream.o \ networking/curl/curlrequest.o \ diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index d1fdabeec9..a0c5470c9f 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -27,7 +27,7 @@ #include "common/scummsys.h" -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) #include "backends/cloud/cloudmanager.h" #include "common/file.h" #endif @@ -47,7 +47,7 @@ #include <errno.h> // for removeSavefile() #endif -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) const char *DefaultSaveFileManager::TIMESTAMPS_FILENAME = "timestamps"; #endif @@ -147,7 +147,7 @@ Common::OutSaveFile *DefaultSaveFileManager::openForSaving(const Common::String } } -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) // Update file's timestamp Common::HashMap<Common::String, uint32> timestamps = loadTimestamps(); timestamps[filename] = INVALID_TIMESTAMP; @@ -182,7 +182,7 @@ bool DefaultSaveFileManager::removeSavefile(const Common::String &filename) { if (getError().getCode() != Common::kNoError) return false; -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) // Update file's timestamp Common::HashMap<Common::String, uint32> timestamps = loadTimestamps(); Common::HashMap<Common::String, uint32>::iterator it = timestamps.find(filename); @@ -247,7 +247,7 @@ void DefaultSaveFileManager::assureCached(const Common::String &savePathName) { // Check that path exists and is usable. checkPath(Common::FSNode(savePathName)); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing if (!files.empty()) updateSavefilesList(files); //makes this cache invalid else _lockedFiles = files; @@ -288,7 +288,7 @@ void DefaultSaveFileManager::assureCached(const Common::String &savePathName) { _cachedDirectory = savePathName; } -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) Common::HashMap<Common::String, uint32> DefaultSaveFileManager::loadTimestamps() { Common::HashMap<Common::String, uint32> timestamps; diff --git a/backends/saves/savefile.cpp b/backends/saves/savefile.cpp index e21ea16ad8..21f53b8de2 100644 --- a/backends/saves/savefile.cpp +++ b/backends/saves/savefile.cpp @@ -23,7 +23,7 @@ #include "common/util.h" #include "common/savefile.h" #include "common/str.h" -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) #include "backends/cloud/cloudmanager.h" #endif @@ -39,7 +39,7 @@ void OutSaveFile::clearErr() { _wrapped->clearErr(); } void OutSaveFile::finalize() { _wrapped->finalize(); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) CloudMan.syncSaves(); #endif } |