half baked auto update (won't affect compile anyway)
update wscript, fix typos in c and mm files
Change-Id: I5eab74662c53d39cd91d621b20c0506da019c09b
diff --git a/osx/auto-update/auto-update.h b/osx/auto-update/auto-update.h
new file mode 100644
index 0000000..14caa32
--- /dev/null
+++ b/osx/auto-update/auto-update.h
@@ -0,0 +1,8 @@
+#ifndef AUTO_UPDATE_H
+#define AUTO_UPDATE_H
+class AutoUpdate
+{
+ public:
+ virtual void checkForUpdates() = 0;
+};
+#endif
diff --git a/osx/auto-update/sparkle-auto-update.h b/osx/auto-update/sparkle-auto-update.h
new file mode 100644
index 0000000..9050bff
--- /dev/null
+++ b/osx/auto-update/sparkle-auto-update.h
@@ -0,0 +1,15 @@
+#ifndef SPARKLE_AUTO_UPDATE_H
+#define SPARKLE_AUTO_UPDATE_H
+#include "auto-update.h"
+#include <QString>
+class SparkleAutoUpdate : public AutoUpdate
+{
+public:
+ SparkleAutoUpdate (const QString &url);
+ ~SparkleAutoUpdate ();
+ virtual void checkForUpdates();
+private:
+ class Private;
+ Private *d;
+}
+#endif
diff --git a/osx/auto-update/sparkle-auto-update.mm b/osx/auto-update/sparkle-auto-update.mm
new file mode 100644
index 0000000..be49b55
--- /dev/null
+++ b/osx/auto-update/sparkle-auto-update.mm
@@ -0,0 +1,28 @@
+#include "sparkle-auto-update.h"
+#import <Sparkle/Sparkle.h>
+
+class SparkleAutoUpdate::Private
+{
+ public:
+ SUUpdater *updater;
+};
+
+SparkleAutoUpdate::SparkleAutoUpdate(const QString &updateUrl)
+{
+ d = new Private;
+ d->updater = [SUUpdater sharedUpdater];
+ [d->updater setAutomaticallyChecksForUpdates:YES];
+ NSURL *url = [NSURL URLWithString: [NSString stringWithUTF8String: updateUrl.toUtf8().data()]];
+ [d->updater setFeedURL: url];
+}
+
+SparkleAutoUpdate::~SparkleAutoUpdate()
+{
+ delete d;
+ // presummably SUUpdater handles garbage collection
+}
+
+void SparkleAutoUpdate::checkForUpdates()
+{
+ [d->updater checkForUpdatesInBackground];
+}