diff options
author | CeRiAl | 2011-07-07 02:47:46 +0200 |
---|---|---|
committer | CeRiAl | 2011-07-19 21:35:37 +0200 |
commit | f60d6f7a9776253ad4716eb8a72fba18c91a7588 (patch) | |
tree | e99be3fb64f837609e13d9219ead8ab69c291226 | |
parent | 828f1884b463c49eb39b7f63def0e4bda15d11c6 (diff) | |
download | scummvm-rg350-f60d6f7a9776253ad4716eb8a72fba18c91a7588.tar.gz scummvm-rg350-f60d6f7a9776253ad4716eb8a72fba18c91a7588.tar.bz2 scummvm-rg350-f60d6f7a9776253ad4716eb8a72fba18c91a7588.zip |
MACOSX/UPDATES: Streamline UpdateManager
Moved UpdateManager related code from backends/modular-backend.* to
common/system.*. Added switch --enable/disable-updates to be able
to disable updates support generally.
-rw-r--r-- | backends/modular-backend.cpp | 6 | ||||
-rw-r--r-- | backends/modular-backend.h | 8 | ||||
-rw-r--r-- | common/system.cpp | 9 | ||||
-rw-r--r-- | common/system.h | 24 | ||||
-rw-r--r-- | common/updates.h | 4 | ||||
-rwxr-xr-x | configure | 25 |
6 files changed, 65 insertions, 11 deletions
diff --git a/backends/modular-backend.cpp b/backends/modular-backend.cpp index db9d816cba..525170d685 100644 --- a/backends/modular-backend.cpp +++ b/backends/modular-backend.cpp @@ -26,7 +26,6 @@ #include "backends/graphics/graphics.h" #include "backends/mutex/mutex.h" -#include "common/updates.h" #include "audio/mixer.h" #include "graphics/pixelformat.h" @@ -35,8 +34,7 @@ ModularBackend::ModularBackend() : _mutexManager(0), _graphicsManager(0), - _mixer(0), - _updateManager(0) { + _mixer(0) { } @@ -45,8 +43,6 @@ ModularBackend::~ModularBackend() { _graphicsManager = 0; delete _mixer; _mixer = 0; - delete _updateManager; - _updateManager = 0; delete _mutexManager; _mutexManager = 0; } diff --git a/backends/modular-backend.h b/backends/modular-backend.h index be1d328c1f..b864da0df5 100644 --- a/backends/modular-backend.h +++ b/backends/modular-backend.h @@ -24,7 +24,6 @@ #define BACKENDS_MODULAR_BACKEND_H #include "backends/base-backend.h" -#include "common/updates.h" class GraphicsManager; class MutexManager; @@ -142,10 +141,9 @@ protected: /** @name Managers variables */ //@{ - MutexManager *_mutexManager; - GraphicsManager *_graphicsManager; - Audio::Mixer *_mixer; - Common::UpdateManager *_updateManager; + MutexManager *_mutexManager; + GraphicsManager *_graphicsManager; + Audio::Mixer *_mixer; //@} }; diff --git a/common/system.cpp b/common/system.cpp index 8d5bfd39cd..59210544ab 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -28,6 +28,7 @@ #include "common/savefile.h" #include "common/str.h" #include "common/taskbar.h" +#include "common/updates.h" #include "common/textconsole.h" #include "backends/audiocd/default/default-audiocd.h" @@ -44,6 +45,9 @@ OSystem::OSystem() { #if defined(USE_TASKBAR) _taskbarManager = 0; #endif +#if defined(USE_UPDATES) + _updateManager = 0; +#endif _fsFactory = 0; } @@ -62,6 +66,11 @@ OSystem::~OSystem() { _taskbarManager = 0; #endif +#if defined(USE_UPDATES) + delete _updateManager; + _updateManager = 0; +#endif + delete _savefileManager; _savefileManager = 0; diff --git a/common/system.h b/common/system.h index 9b833c5b1a..600778d8e1 100644 --- a/common/system.h +++ b/common/system.h @@ -45,6 +45,9 @@ class String; #if defined(USE_TASKBAR) class TaskbarManager; #endif +#if defined(USE_UPDATES) +class UpdateManager; +#endif class TimerManager; class SeekableReadStream; class WriteStream; @@ -161,6 +164,15 @@ protected: Common::TaskbarManager *_taskbarManager; #endif +#if defined(USE_UPDATES) + /** + * No default value is provided for _updateManager by OSystem. + * + * @note _updateManager is deleted by the OSystem destructor. + */ + Common::UpdateManager *_updateManager; +#endif + /** * No default value is provided for _fsFactory by OSystem. * @@ -1071,6 +1083,18 @@ public: } #endif +#if defined(USE_UPDATES) + /** + * Returns the UpdateManager, used to handle auto-updating, + * and updating of ScummVM in general. + * + * @return the UpdateManager for the current architecture + */ + virtual Common::UpdateManager *getUpdateManager() { + return _updateManager; + } +#endif + /** * Returns the FilesystemFactory object, depending on the current architecture. * diff --git a/common/updates.h b/common/updates.h index c0dbbaac05..1e0babdf6d 100644 --- a/common/updates.h +++ b/common/updates.h @@ -23,6 +23,8 @@ #ifndef BACKENDS_UPDATES_ABSTRACT_H #define BACKENDS_UPDATES_ABSTRACT_H +#if defined(USE_UPDATES) + namespace Common { /** @@ -95,4 +97,6 @@ public: } // End of namespace Common +#endif + #endif // BACKENDS_UPDATES_ABSTRACT_H @@ -143,6 +143,7 @@ _opengl=auto _opengles=auto _readline=auto _taskbar=yes +_updates=yes _libunity=auto # Default option behaviour yes/no _debug_build=auto @@ -773,6 +774,7 @@ Optional Features: --disable-hq-scalers exclude HQ2x and HQ3x scalers --disable-translation don't build support for translated messages --disable-taskbar don't build support for taskbar and launcher integration + --disable-updates don't build support for updates --enable-text-console use text console instead of graphical console --enable-verbose-build enable regular echoing of commands during build process @@ -880,6 +882,8 @@ for ac_option in $@; do --disable-readline) _readline=no ;; --enable-taskbar) _taskbar=yes ;; --disable-taskbar) _taskbar=no ;; + --enable-updates) _updates=yes ;; + --disable-updates) _updates=no ;; --enable-libunity) _libunity=yes ;; --disable-libunity) _libunity=no ;; --enable-opengl) _opengl=yes ;; @@ -2982,9 +2986,12 @@ if test `get_engine_build sword25` = yes && test ! "$_zlib" = yes ; then fi # -# Check for Sparkle +# Check for Sparkle if updates support is enabled # echocheck "Sparkle" +if test "$_updates" = no; then + _sparkle=no +else if test "$_sparkle" = auto ; then _sparkle=no cat > $TMPC << EOF @@ -2999,6 +3006,7 @@ if test "$_sparkle" = yes ; then INCLUDES="$INCLUDES $SPARKLE_CFLAGS" fi define_in_config_if_yes "$_sparkle" 'USE_SPARKLE' +fi echo "$_sparkle" # @@ -3308,6 +3316,21 @@ define_in_config_if_yes $_bink 'USE_BINK' echo "$_bink" # +# Check whether to build updates support +# +echo_n "Building updates support... " +define_in_config_if_yes $_updates 'USE_UPDATES' +if test "$_updates" = yes; then + if test "$_sparkle" = yes; then + echo "Sparkle" + else + echo "$_updates" + fi +else + echo "$_updates" +fi + +# # Figure out installation directories # test "x$prefix" = xNONE && prefix=/usr/local |