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

sev- sev at scummvm.org
Mon Oct 17 18:55:32 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:
e8b70a4686 ALL: Fix compilation with disabled cloud but enabled libcurl
c5e233b66b ALL: Fix compilation with enabled sdl_net and disabled cloud


Commit: e8b70a4686916774a1bf499c9c3136e3052b6b43
    https://github.com/scummvm/scummvm/commit/e8b70a4686916774a1bf499c9c3136e3052b6b43
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-10-17T18:55:22+02:00

Commit Message:
ALL: Fix compilation with disabled cloud but enabled libcurl

Changed paths:
    backends/module.mk
    backends/saves/default/default-saves.cpp
    backends/saves/savefile.cpp
    base/main.cpp
    configure
    gui/editgamedialog.cpp
    gui/launcher.cpp
    gui/module.mk
    gui/options.cpp
    gui/saveload-dialog.cpp
    gui/saveload-dialog.h
    gui/saveload.cpp



diff --git a/backends/module.mk b/backends/module.mk
index 10dde0b..158f9a3 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 d1fdabe..a0c5470 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 e21ea16..21f53b8 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 ca3a764..42f5910 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();
diff --git a/configure b/configure
index 6c2bf46..b22a7e6 100755
--- a/configure
+++ b/configure
@@ -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 a4731c1..36af271 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 50f060d..cf9c0bf 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 54818c2..5b32689 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 7a5f9d4..7965cfd 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 4ae8732..af02e36 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 fb28333..43721aa 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 3072aa6..2ac68dd 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
 


Commit: c5e233b66b1acff08b2506f6536253bb6af8c851
    https://github.com/scummvm/scummvm/commit/c5e233b66b1acff08b2506f6536253bb6af8c851
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-10-17T18:55:22+02:00

Commit Message:
ALL: Fix compilation with enabled sdl_net and disabled cloud

Changed paths:
    gui/options.cpp



diff --git a/gui/options.cpp b/gui/options.cpp
index 7965cfd..4ebb60b 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -1312,7 +1312,7 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher)
 	ScrollContainerWidget *container = new ScrollContainerWidget(tab, "GlobalOptions_Cloud.Container", kCloudTabContainerReflowCmd);
 	container->setTarget(this);
 
-#if defined(USE_CLOUD) && defined(USE_LIBCURL)
+#ifdef USE_LIBCURL
 	_selectedStorageIndex = CloudMan.getStorageIndex();
 #else
 	_selectedStorageIndex = 0;
@@ -1320,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");
-#if defined(USE_CLOUD) && defined(USE_LIBCURL)
+#ifdef USE_LIBCURL
 	Common::StringArray list = CloudMan.listStorages();
 	for (uint32 i = 0; i < list.size(); ++i)
 		_storagePopUp->appendEntry(list[i], i);
@@ -1368,7 +1368,7 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher)
 #ifdef USE_SDL_NET
 	_serverWasRunning = false;
 #endif
-#endif
+#endif // USE_CLOUD
 
 	// Activate the first tab
 	tab->setActiveTab(0);
@@ -1553,6 +1553,7 @@ void GlobalOptionsDialog::close() {
 			}
 		}
 #endif // USE_LIBCURL
+
 #ifdef USE_SDL_NET
 #ifdef NETWORKING_LOCALWEBSERVER_ENABLE_PORT_OVERRIDE
 		// save server's port
@@ -1567,7 +1568,7 @@ void GlobalOptionsDialog::close() {
 #endif // USE_SDL_NET
 #endif // USE_CLOUD
 	}
-#ifdef USE_SDL_NET
+#if defined(USE_CLOUD) && defined(USE_SDL_NET)
 	if (LocalServer.isRunning()) {
 		LocalServer.stop();
 	}





More information about the Scummvm-git-logs mailing list