many osx sparkle fixes 0.9.18
authorkoda
Fri, 02 Nov 2012 00:06:11 +0100
branch0.9.18
changeset 7933 223b3a195474
parent 7930 a4320272bb9a
child 7934 c07e0a3a3ce3
many osx sparkle fixes
CMakeLists.txt
QTfrontend/SparkleAutoUpdater.h
QTfrontend/SparkleAutoUpdater.mm
QTfrontend/hwform.cpp
cmake_modules/FindSparkle.cmake
share/Info.plist.in
--- a/CMakeLists.txt	Fri Nov 02 00:03:56 2012 +0100
+++ b/CMakeLists.txt	Fri Nov 02 00:06:11 2012 +0100
@@ -55,6 +55,8 @@
 
 option(BUILD_ENGINE_LIBRARY "Enable hwengine library [default: off]" OFF)
 option(ANDROID "Enable Android build [default: off]" OFF)
+
+option(NOAUTOUPDATE "Disable OS X Sparkle update checking" OFF)
 option(CROSSAPPLE "Enable OSX when not on OSX [default: off]" OFF)
 
 
--- a/QTfrontend/SparkleAutoUpdater.h	Fri Nov 02 00:03:56 2012 +0100
+++ b/QTfrontend/SparkleAutoUpdater.h	Fri Nov 02 00:06:11 2012 +0100
@@ -12,10 +12,11 @@
 class SparkleAutoUpdater : public AutoUpdater
 {
     public:
-        SparkleAutoUpdater(const QString& url);
+        SparkleAutoUpdater();
         ~SparkleAutoUpdater();
 
         void checkForUpdates();
+        void checkForUpdatesNow();
 
     private:
         class Private;
--- a/QTfrontend/SparkleAutoUpdater.mm	Fri Nov 02 00:03:56 2012 +0100
+++ b/QTfrontend/SparkleAutoUpdater.mm	Fri Nov 02 00:06:11 2012 +0100
@@ -29,15 +29,12 @@
         SUUpdater* updater;
 };
 
-SparkleAutoUpdater::SparkleAutoUpdater(const QString& aUrl)
+SparkleAutoUpdater::SparkleAutoUpdater()
 {
     d = new Private;
 
     d->updater = [SUUpdater sharedUpdater];
     [d->updater retain];
-
-    NSURL* url = [NSURL URLWithString:[NSString stringWithUTF8String:aUrl.toUtf8().data()]];
-    [d->updater setFeedURL:url];
 }
 
 SparkleAutoUpdater::~SparkleAutoUpdater()
@@ -50,3 +47,8 @@
 {
     [d->updater checkForUpdatesInBackground];
 }
+
+void SparkleAutoUpdater::checkForUpdatesNow()
+{
+    [d->updater checkForUpdates:NULL];
+}
--- a/QTfrontend/hwform.cpp	Fri Nov 02 00:03:56 2012 +0100
+++ b/QTfrontend/hwform.cpp	Fri Nov 02 00:06:11 2012 +0100
@@ -100,7 +100,6 @@
 #ifdef __APPLE__
 #include "M3Panel.h"
 #ifdef SPARKLE_ENABLED
-#define SPARKLE_APPCAST_URL "http://www.hedgewars.org/download/appcast.xml"
 #include "SparkleAutoUpdater.h"
 #endif
 #endif
@@ -152,7 +151,7 @@
 #ifdef SPARKLE_ENABLED
     AutoUpdater* updater;
 
-    updater = new SparkleAutoUpdater(SPARKLE_APPCAST_URL);
+    updater = new SparkleAutoUpdater();
     if (updater && config->isAutoUpdateEnabled())
         updater->checkForUpdates();
 #endif
--- a/cmake_modules/FindSparkle.cmake	Fri Nov 02 00:03:56 2012 +0100
+++ b/cmake_modules/FindSparkle.cmake	Fri Nov 02 00:06:11 2012 +0100
@@ -24,14 +24,14 @@
 endif ()
 
 if (SPARKLE_FOUND)
-   if (NOT Sparkle_FIND_QUIETLY)
+   if (NOT SPARKLE_FIND_QUIETLY)
       message(STATUS "Found Sparkle: ${SPARKLE_LIBRARY}")
    endif ()
 else ()
-   if (Sparkle_FIND_REQUIRED)
+   if (SPARKLE_FIND_REQUIRED)
       message(FATAL_ERROR "Could NOT find Sparkle framework")
    else ()
-      if (NOT Sparkle_FIND_QUIETLY)
+      if (NOT SPARKLE_FIND_QUIETLY)
          message(STATUS "Could NOT find Sparkle framework, autoupdate feature will be disabled")
       endif()
    endif ()
--- a/share/Info.plist.in	Fri Nov 02 00:03:56 2012 +0100
+++ b/share/Info.plist.in	Fri Nov 02 00:06:11 2012 +0100
@@ -47,6 +47,8 @@
 	<string>${minimum_macosx_version}</string>
 	<key>SUPublicDSAKeyFile</key>
 	<string>dsa_pub.pem</string>
+	<key>SUFeedURL</key>
+	<string>http://www.hedgewars.org/download/appcast.xml</string>
 	<key>CFBundleLocalizations</key>
 	<array>
 		<string>ar</string>