# HG changeset patch
# User koda
# Date 1351811171 -3600
# Node ID 223b3a1954742d2e79a9c2acfba299fbe62a45fd
# Parent a4320272bb9a62b73e637a8e9768dbbdc5e221cc
many osx sparkle fixes
diff -r a4320272bb9a -r 223b3a195474 CMakeLists.txt
--- 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)
diff -r a4320272bb9a -r 223b3a195474 QTfrontend/SparkleAutoUpdater.h
--- 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;
diff -r a4320272bb9a -r 223b3a195474 QTfrontend/SparkleAutoUpdater.mm
--- 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];
+}
diff -r a4320272bb9a -r 223b3a195474 QTfrontend/hwform.cpp
--- 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
diff -r a4320272bb9a -r 223b3a195474 cmake_modules/FindSparkle.cmake
--- 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 ()
diff -r a4320272bb9a -r 223b3a195474 share/Info.plist.in
--- 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 @@
${minimum_macosx_version}
SUPublicDSAKeyFile
dsa_pub.pem
+ SUFeedURL
+ http://www.hedgewars.org/download/appcast.xml
CFBundleLocalizations
ar