diff options
author | Eugene Sandulenko | 2016-10-17 18:45:12 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-10-17 18:55:22 +0200 |
commit | e8b70a4686916774a1bf499c9c3136e3052b6b43 (patch) | |
tree | 93ca440db8e01bf53376909ebb5670f961613c8b | |
parent | d3c173da7aa3ffcb62243816bd74ccb4ca3ec5b2 (diff) | |
download | scummvm-rg350-e8b70a4686916774a1bf499c9c3136e3052b6b43.tar.gz scummvm-rg350-e8b70a4686916774a1bf499c9c3136e3052b6b43.tar.bz2 scummvm-rg350-e8b70a4686916774a1bf499c9c3136e3052b6b43.zip |
ALL: Fix compilation with disabled cloud but enabled libcurl
-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 | ||||
-rw-r--r-- | base/main.cpp | 6 | ||||
-rwxr-xr-x | configure | 8 | ||||
-rw-r--r-- | gui/editgamedialog.cpp | 4 | ||||
-rw-r--r-- | gui/launcher.cpp | 4 | ||||
-rw-r--r-- | gui/module.mk | 2 | ||||
-rw-r--r-- | gui/options.cpp | 12 | ||||
-rw-r--r-- | gui/saveload-dialog.cpp | 18 | ||||
-rw-r--r-- | gui/saveload-dialog.h | 4 | ||||
-rw-r--r-- | gui/saveload.cpp | 2 |
12 files changed, 46 insertions, 39 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 } diff --git a/base/main.cpp b/base/main.cpp index ca3a764f3a..42f5910b3b 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -66,6 +66,7 @@ #endif #include "backends/keymapper/keymapper.h" +#ifdef USE_CLOUD #ifdef USE_LIBCURL #include "backends/cloud/cloudmanager.h" #include "backends/networking/curl/connectionmanager.h" @@ -73,6 +74,7 @@ #ifdef USE_SDL_NET #include "backends/networking/sdl_net/localwebserver.h" #endif +#endif #if defined(_WIN32_WCE) #include "backends/platform/wince/CELauncherDialog.h" @@ -485,7 +487,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { } #endif -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) CloudMan.init(); CloudMan.syncSaves(); #endif @@ -598,6 +600,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { launcherDialog(); } } +#ifdef USE_CLOUD #ifdef USE_SDL_NET Networking::LocalWebserver::destroy(); #endif @@ -606,6 +609,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { //I think it's important to destroy it after ConnectionManager Cloud::CloudManager::destroy(); #endif +#endif PluginManager::instance().unloadAllPlugins(); PluginManager::destroy(); GUI::GuiManager::destroy(); @@ -3350,14 +3350,6 @@ esac append_var MODULES "backends/platform/$_backend" # -# Disasble use of SDL_net and libcurl is cloud is disabled -# -if test "$_cloud" = no ; then - _sdlnet=no; - _libcurl=no; -fi - -# # Setup SDL specifics for SDL based backends # case $_backend in diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp index a4731c1595..36af271d2c 100644 --- a/gui/editgamedialog.cpp +++ b/gui/editgamedialog.cpp @@ -38,7 +38,7 @@ #include "gui/widgets/tab.h" #include "gui/widgets/popup.h" -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) #include "backends/cloud/cloudmanager.h" #endif @@ -506,7 +506,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat // User made his choice... Common::FSNode dir(browser.getResult()); _savePathWidget->setLabel(dir.getPath()); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) MessageDialog warningMessage(_("Saved games sync feature doesn't work with non-default directories. If you want your saved games to sync, use default directory.")); warningMessage.runModal(); #endif diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 50f060de65..cf9c0bf56d 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -52,7 +52,7 @@ #include "gui/ThemeEval.h" #include "graphics/cursorman.h" -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) #include "backends/cloud/cloudmanager.h" #endif @@ -328,7 +328,7 @@ void LauncherDialog::addGame() { if (_browser->runModal() > 0) { // User made his choice... -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) String selectedDirectory = _browser->getResult().getPath(); String bannedDirectory = CloudMan.getDownloadLocalDirectory(); if (selectedDirectory.size() && selectedDirectory.lastChar() != '/' && selectedDirectory.lastChar() != '\\') diff --git a/gui/module.mk b/gui/module.mk index 54818c264e..5b32689a82 100644 --- a/gui/module.mk +++ b/gui/module.mk @@ -58,12 +58,14 @@ MODULE_OBJS += \ endif endif +ifdef USE_CLOUD ifdef USE_LIBCURL MODULE_OBJS += \ downloaddialog.o \ remotebrowser.o \ storagewizarddialog.o endif +endif ifdef ENABLE_EVENTRECORDER MODULE_OBJS += \ diff --git a/gui/options.cpp b/gui/options.cpp index 7a5f9d4386..7965cfd752 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -45,6 +45,7 @@ #include "widgets/scrollcontainer.h" #include "widgets/edittext.h" +#ifdef USE_CLOUD #ifdef USE_LIBCURL #include "backends/cloud/cloudmanager.h" #include "gui/downloaddialog.h" @@ -54,6 +55,7 @@ #ifdef USE_SDL_NET #include "backends/networking/sdl_net/localwebserver.h" #endif +#endif namespace GUI { @@ -412,7 +414,7 @@ void OptionsDialog::close() { g_system->setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen", _domain)); if (ConfMan.hasKey("filtering")) g_system->setFeatureState(OSystem::kFeatureFilteringMode, ConfMan.getBool("filtering", _domain)); - + OSystem::TransactionError gfxError = g_system->endGFXTransaction(); // Since this might change the screen resolution we need to give @@ -455,7 +457,7 @@ void OptionsDialog::close() { message += "\n"; message += _("the fullscreen setting could not be changed"); } - + if (gfxError & OSystem::kTransactionFilteringFailed) { ConfMan.setBool("filtering", g_system->getFeatureState(OSystem::kFeatureFilteringMode), _domain); message += "\n"; @@ -806,7 +808,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr // Fullscreen checkbox _fullscreenCheckbox = new CheckboxWidget(boss, prefix + "grFullscreenCheckbox", _("Fullscreen mode")); - + // Filtering checkbox _filteringCheckbox = new CheckboxWidget(boss, prefix + "grFilteringCheckbox", _("Filter graphics"), _("Use linear filtering when scaling graphics")); @@ -1310,7 +1312,7 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher) ScrollContainerWidget *container = new ScrollContainerWidget(tab, "GlobalOptions_Cloud.Container", kCloudTabContainerReflowCmd); container->setTarget(this); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) _selectedStorageIndex = CloudMan.getStorageIndex(); #else _selectedStorageIndex = 0; @@ -1318,7 +1320,7 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher) _storagePopUpDesc = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StoragePopupDesc", _("Storage:"), _("Active cloud storage")); _storagePopUp = new PopUpWidget(container, "GlobalOptions_Cloud_Container.StoragePopup"); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) Common::StringArray list = CloudMan.listStorages(); for (uint32 i = 0; i < list.size(); ++i) _storagePopUp->appendEntry(list[i], i); diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp index 4ae873229f..af02e36c13 100644 --- a/gui/saveload-dialog.cpp +++ b/gui/saveload-dialog.cpp @@ -22,7 +22,7 @@ #include "gui/saveload-dialog.h" -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) #include "backends/cloud/cloudmanager.h" #include "backends/cloud/savessyncrequest.h" #include "backends/networking/curl/connectionmanager.h" @@ -41,7 +41,7 @@ namespace GUI { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) enum { kCancelSyncCmd = 'PDCS', @@ -157,7 +157,7 @@ SaveLoadChooserDialog::SaveLoadChooserDialog(int x, int y, int w, int h, const b } SaveLoadChooserDialog::~SaveLoadChooserDialog() { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) CloudMan.setSyncTarget(nullptr); //not that dialog, at least #endif } @@ -173,7 +173,7 @@ void SaveLoadChooserDialog::open() { } void SaveLoadChooserDialog::close() { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) CloudMan.setSyncTarget(nullptr); //not that dialog, at least #endif Dialog::close(); @@ -215,7 +215,7 @@ void SaveLoadChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uin } #endif // !DISABLE_SAVELOADCHOOSER_GRID -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) if (cmd == kSavesSyncProgressCmd || cmd == kSavesSyncEndedCmd) { //this dialog only gets these commands if the progress dialog was shown and user clicked "run in background" return updateSaveList(); @@ -225,7 +225,7 @@ void SaveLoadChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uin return Dialog::handleCommand(sender, cmd, data); } -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) void SaveLoadChooserDialog::runSaveSync(bool hasSavepathOverride) { if (!CloudMan.isSyncing()) { if (hasSavepathOverride) { @@ -240,7 +240,7 @@ void SaveLoadChooserDialog::runSaveSync(bool hasSavepathOverride) { #endif void SaveLoadChooserDialog::handleTickle() { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) if (!_dialogWasShown && CloudMan.isSyncing()) { Common::Array<Common::String> files = CloudMan.getSyncingFiles(); if (!files.empty()) { @@ -280,7 +280,7 @@ void SaveLoadChooserDialog::reflowLayout() { } void SaveLoadChooserDialog::updateSaveList() { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing g_system->getSavefileManager()->updateSavefilesList(files); #endif @@ -291,7 +291,7 @@ void SaveLoadChooserDialog::listSaves() { if (!_metaEngine) return; //very strange _saveList = _metaEngine->listSaves(_target.c_str()); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) //if there is Cloud support, add currently synced files as "locked" saves in the list if (_metaEngine->hasFeature(MetaEngine::kSimpleSavesNames)) { Common::String pattern = _target + ".###"; diff --git a/gui/saveload-dialog.h b/gui/saveload-dialog.h index fb2833355f..43721aa270 100644 --- a/gui/saveload-dialog.h +++ b/gui/saveload-dialog.h @@ -30,7 +30,7 @@ namespace GUI { -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) enum SaveLoadCloudSyncProgress { kSavesSyncProgressCmd = 'SSPR', kSavesSyncEndedCmd = 'SSEN' @@ -81,7 +81,7 @@ public: virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) virtual void runSaveSync(bool hasSavepathOverride); #endif diff --git a/gui/saveload.cpp b/gui/saveload.cpp index 3072aa6082..2ac68dd8f9 100644 --- a/gui/saveload.cpp +++ b/gui/saveload.cpp @@ -87,7 +87,7 @@ int SaveLoadChooser::runModalWithPluginAndTarget(const EnginePlugin *plugin, con if (!_impl) return -1; -#ifdef USE_LIBCURL +#if defined(USE_CLOUD) && defined(USE_LIBCURL) _impl->runSaveSync(ConfMan.hasKey("savepath", target)); #endif |