[Scummvm-cvs-logs] scummvm master -> 7e7e6069193fead17d0865d252400b6826805ffc

vinterstum oystein at geheb.com
Wed Aug 3 03:04:31 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7e7e606919 MACOSX: Turned update support off by default, simplified and cleaned the pull request


Commit: 7e7e6069193fead17d0865d252400b6826805ffc
    https://github.com/scummvm/scummvm/commit/7e7e6069193fead17d0865d252400b6826805ffc
Author: Oystein Eftevaag (oystein at geheb.com)
Date: 2011-08-02T18:00:57-07:00

Commit Message:
MACOSX: Turned update support off by default, simplified and cleaned the pull request

Changed paths:
  R backends/updates/sparkle-updates.cpp
  R backends/updates/sparkle-updates.h
    backends/module.mk
    backends/platform/sdl/macosx/macosx.cpp
    backends/updates/macosx/macosx-updates.h
    backends/updates/macosx/macosx-updates.mm
    configure



diff --git a/backends/module.mk b/backends/module.mk
index d8b423a..0e94426 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -15,8 +15,7 @@ MODULE_OBJS := \
 	midi/timidity.o \
 	saves/savefile.o \
 	saves/default/default-saves.o \
-	timer/default/default-timer.o \
-	updates/sparkle-updates.o
+	timer/default/default-timer.o
 
 
 ifdef USE_ELF_LOADER
diff --git a/backends/platform/sdl/macosx/macosx.cpp b/backends/platform/sdl/macosx/macosx.cpp
index 39fd423..d9de4e5 100644
--- a/backends/platform/sdl/macosx/macosx.cpp
+++ b/backends/platform/sdl/macosx/macosx.cpp
@@ -64,7 +64,7 @@ void OSystem_MacOSX::initBackend() {
 	// Replace the SDL generated menu items with our own translated ones on Mac OS X
 	replaceApplicationMenuItems();
 
-#if defined(USE_SPARKLE)
+#ifdef USE_SPARKLE
 	// Initialize updates manager
 	_updateManager = new MacOSXUpdateManager();
 #endif
diff --git a/backends/updates/macosx/macosx-updates.h b/backends/updates/macosx/macosx-updates.h
index 1fe0e4b..8c9ac1f 100644
--- a/backends/updates/macosx/macosx-updates.h
+++ b/backends/updates/macosx/macosx-updates.h
@@ -23,11 +23,13 @@
 #ifndef BACKENDS_UPDATES_MACOSX_H
 #define BACKENDS_UPDATES_MACOSX_H
 
-#include "backends/updates/sparkle-updates.h"
+#include "common/scummsys.h"
 
 #if defined(MACOSX) && defined(USE_SPARKLE)
 
-class MacOSXUpdateManager : public SparkleUpdateManager {
+#include "common/updates.h"
+
+class MacOSXUpdateManager : public Common::UpdateManager {
 public:
 	MacOSXUpdateManager();
 	virtual ~MacOSXUpdateManager();
diff --git a/backends/updates/macosx/macosx-updates.mm b/backends/updates/macosx/macosx-updates.mm
index f3675f9..741e898 100644
--- a/backends/updates/macosx/macosx-updates.mm
+++ b/backends/updates/macosx/macosx-updates.mm
@@ -23,11 +23,9 @@
 // Disable symbol overrides so that we can use system headers.
 #define FORBIDDEN_SYMBOL_ALLOW_ALL
 
-#include "backends/updates/sparkle-updates.h"
-
-#if defined(MACOSX) && defined(USE_SPARKLE)
-
 #include "backends/updates/macosx/macosx-updates.h"
+
+#ifdef USE_SPARKLE
 #include "common/translation.h"
 
 #include <Cocoa/Cocoa.h>
@@ -53,8 +51,12 @@ MacOSXUpdateManager::MacOSXUpdateManager() {
 	// Init Sparkle
 	sparkleUpdater = [SUUpdater sharedUpdater];
 
+	NSBundle* mainBundle = [NSBundle mainBundle];
+
+	NSString* feedbackURL = [mainBundle objectForInfoDictionaryKey:@"SUFeedURL"];
+
 	// Set appcast URL
-	[sparkleUpdater setFeedURL:[NSURL URLWithString:[NSString stringWithCString:getAppcastUrl().c_str()]]];
+	[sparkleUpdater setFeedURL:[NSURL URLWithString:feedbackURL]];
 
 	// Get current encoding
 	NSStringEncoding stringEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)[NSString stringWithCString:(TransMan.getCurrentCharset()).c_str() encoding:NSASCIIStringEncoding]));
@@ -108,22 +110,18 @@ Common::UpdateManager::UpdateInterval MacOSXUpdateManager::getUpdateCheckInterva
 	// This is kind of a hack but necessary, as the value stored by Sparkle
 	// might have been changed outside of ScummVM (in which case we return the
 	// default interval of one day)
-	switch ((UpdateInterval)[sparkleUpdater updateCheckInterval]) {
-		default:
-			break;
-
-		case kUpdateIntervalOneDay:
-			return kUpdateIntervalOneDay;
 
-		case kUpdateIntervalOneWeek:
-			return kUpdateIntervalOneWeek;
+	UpdateInterval updateInterval = (UpdateInterval)[sparkleUpdater updateCheckInterval];
+	switch (updateInterval) {
+	case kUpdateIntervalOneDay:
+	case kUpdateIntervalOneWeek:
+	case kUpdateIntervalOneMonth:
+		return updateInterval;
 
-		case kUpdateIntervalOneMonth:
-			return kUpdateIntervalOneMonth;
+	default:
+		// Return the default value (one day)
+		return kUpdateIntervalOneDay;
 	}
-
-	// Return the default value (one day)
-	return kUpdateIntervalOneDay;
 }
 
 #endif
diff --git a/backends/updates/sparkle-updates.cpp b/backends/updates/sparkle-updates.cpp
deleted file mode 100644
index f146237..0000000
--- a/backends/updates/sparkle-updates.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "backends/updates/sparkle-updates.h"
-
-#if defined(USE_SPARKLE)
-
-// TODO replace by proper URL
-#if defined(MACOSX)
-	#define APPCAST_BASE_URL "http://www.scummvm.org/appcasts/macosx/"
-#elif defined(WIN32)
-	#define APPCAST_BASE_URL "http://www.scummvm.org/appcasts/win32/"
-#else
-	#error "Please define APPCAST_BASE_URL for your platform!"
-#endif
-
-
-Common::String SparkleUpdateManager::getAppcastUrl() {
-#ifdef RELEASE_BUILD
-	return APPCAST_BASE_URL "release.xml";
-#else
-	return APPCAST_BASE_URL "beta.xml";
-#endif
-}
-
-#endif
diff --git a/backends/updates/sparkle-updates.h b/backends/updates/sparkle-updates.h
deleted file mode 100644
index 26f170d..0000000
--- a/backends/updates/sparkle-updates.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef BACKENDS_UPDATES_SPARKLE_UPDATE_H
-#define BACKENDS_UPDATES_SPARKLE_UPDATE_H
-
-#include "common/scummsys.h"
-#include "common/str.h"
-#include "common/updates.h"
-
-#if defined(USE_SPARKLE)
-
-class SparkleUpdateManager : public Common::UpdateManager {
-public:
-	/**
-	 * Gets the appcast url.
-	 *
-	 * Beta/RC versions and releases might have a different appcast url.
-	 * This function takes care of checking which version of ScummVM is running
-	 * and return the url to the proper appcast.
-	 *
-	 * @return the appcast url.
-	 */
-	Common::String getAppcastUrl();
-};
-
-#endif
-
-#endif // BACKENDS_UPDATES_SPARKLE_UPDATE_H
diff --git a/configure b/configure
index 8045a8b..2221c85 100755
--- a/configure
+++ b/configure
@@ -144,7 +144,7 @@ _opengl=auto
 _opengles=auto
 _readline=auto
 _taskbar=yes
-_updates=yes
+_updates=no
 _libunity=auto
 # Default option behaviour yes/no
 _debug_build=auto
@@ -775,7 +775,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-updates         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






More information about the Scummvm-git-logs mailing list