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.
This commit is contained in:
CeRiAl 2011-07-07 02:47:46 +02:00
parent 828f1884b4
commit f60d6f7a97
6 changed files with 65 additions and 11 deletions

View file

@ -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;
}

View file

@ -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;
//@}
};

View file

@ -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"
@ -43,6 +44,9 @@ OSystem::OSystem() {
_savefileManager = 0;
#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;

View file

@ -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.
*

View file

@ -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

25
configure vendored
View file

@ -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"
#
@ -3307,6 +3315,21 @@ echo_n "Building Bink video support... "
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
#