diff options
Diffstat (limited to 'SwifTools/AutoUpdater')
-rw-r--r-- | SwifTools/AutoUpdater/DummyAutoUpdater.h | 10 | ||||
-rw-r--r-- | SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.cpp | 14 | ||||
-rw-r--r-- | SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.h | 2 | ||||
-rw-r--r-- | SwifTools/AutoUpdater/SparkleAutoUpdater.mm | 1 |
4 files changed, 14 insertions, 13 deletions
diff --git a/SwifTools/AutoUpdater/DummyAutoUpdater.h b/SwifTools/AutoUpdater/DummyAutoUpdater.h deleted file mode 100644 index bdddb2a..0000000 --- a/SwifTools/AutoUpdater/DummyAutoUpdater.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "SwifTools/AutoUpdater/AutoUpdater.h" - -namespace Swift { - class DummyAutoUpdater : public AutoUpdater { - public: - void checkForUpdates() {} - }; -} diff --git a/SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.cpp b/SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.cpp index 90c27bd..4f591f5 100644 --- a/SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.cpp +++ b/SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.cpp @@ -1,19 +1,27 @@ #include "SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.h" +#include <cassert> + #ifdef HAVE_SPARKLE #include "SwifTools/AutoUpdater/SparkleAutoUpdater.h" -#else -#include "SwifTools/AutoUpdater/DummyAutoUpdater.h" #endif namespace Swift { +bool PlatformAutoUpdaterFactory::isSupported() const { +#ifdef HAVE_SPARKLE + return true; +#else + return false; +#endif +} + AutoUpdater* PlatformAutoUpdaterFactory::createAutoUpdater(const String& appcastURL) { #ifdef HAVE_SPARKLE return new SparkleAutoUpdater(appcastURL); #else (void) appcastURL; - return new DummyAutoUpdater(); + return NULL; #endif } diff --git a/SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.h b/SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.h index 6d16c68..76520e2 100644 --- a/SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.h +++ b/SwifTools/AutoUpdater/PlatformAutoUpdaterFactory.h @@ -5,6 +5,8 @@ namespace Swift { class PlatformAutoUpdaterFactory { public: + bool isSupported() const; + AutoUpdater* createAutoUpdater(const String& appcastURL); }; } diff --git a/SwifTools/AutoUpdater/SparkleAutoUpdater.mm b/SwifTools/AutoUpdater/SparkleAutoUpdater.mm index 30e2ae2..a8ae60a 100644 --- a/SwifTools/AutoUpdater/SparkleAutoUpdater.mm +++ b/SwifTools/AutoUpdater/SparkleAutoUpdater.mm @@ -15,6 +15,7 @@ SparkleAutoUpdater::SparkleAutoUpdater(const String& url) { d->updater = [SUUpdater sharedUpdater]; [d->updater retain]; + [d->updater setAutomaticallyChecksForUpdates: true]; NSURL* nsurl = [NSURL URLWithString: [NSString stringWithUTF8String: url.getUTF8Data()]]; |