aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorCeRiAl2011-07-07 02:47:46 +0200
committerCeRiAl2011-07-19 21:35:37 +0200
commitf60d6f7a9776253ad4716eb8a72fba18c91a7588 (patch)
treee99be3fb64f837609e13d9219ead8ab69c291226 /common
parent828f1884b463c49eb39b7f63def0e4bda15d11c6 (diff)
downloadscummvm-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.
Diffstat (limited to 'common')
-rw-r--r--common/system.cpp9
-rw-r--r--common/system.h24
-rw-r--r--common/updates.h4
3 files changed, 37 insertions, 0 deletions
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