summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'SwifTools/AutoUpdater/SparkleAutoUpdater.mm')
-rw-r--r--SwifTools/AutoUpdater/SparkleAutoUpdater.mm33
1 files changed, 33 insertions, 0 deletions
diff --git a/SwifTools/AutoUpdater/SparkleAutoUpdater.mm b/SwifTools/AutoUpdater/SparkleAutoUpdater.mm
new file mode 100644
index 0000000..30e2ae2
--- /dev/null
+++ b/SwifTools/AutoUpdater/SparkleAutoUpdater.mm
@@ -0,0 +1,33 @@
+#include "SwifTools/AutoUpdater/SparkleAutoUpdater.h"
+
+#include <Cocoa/Cocoa.h>
+#include <Sparkle/Sparkle.h>
+
+namespace Swift {
+
+class SparkleAutoUpdater::Private {
+ public:
+ SUUpdater* updater;
+};
+
+SparkleAutoUpdater::SparkleAutoUpdater(const String& url) {
+ d = new Private;
+
+ d->updater = [SUUpdater sharedUpdater];
+ [d->updater retain];
+
+ NSURL* nsurl = [NSURL URLWithString:
+ [NSString stringWithUTF8String: url.getUTF8Data()]];
+ [d->updater setFeedURL: nsurl];
+}
+
+SparkleAutoUpdater::~SparkleAutoUpdater() {
+ [d->updater release];
+ delete d;
+}
+
+void SparkleAutoUpdater::checkForUpdates() {
+ [d->updater checkForUpdatesInBackground];
+}
+
+}