ALL: Fix compilation with disabled cloud but enabled libcurl
This commit is contained in:
parent
d3c173da7a
commit
e8b70a4686
12 changed files with 46 additions and 39 deletions
|
@ -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 \
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -605,6 +608,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
|
|||
Networking::ConnectionManager::destroy();
|
||||
//I think it's important to destroy it after ConnectionManager
|
||||
Cloud::CloudManager::destroy();
|
||||
#endif
|
||||
#endif
|
||||
PluginManager::instance().unloadAllPlugins();
|
||||
PluginManager::destroy();
|
||||
|
|
8
configure
vendored
8
configure
vendored
|
@ -3349,14 +3349,6 @@ case $_backend in
|
|||
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
|
||||
#
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() != '\\')
|
||||
|
|
|
@ -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 += \
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 + ".###";
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue