blob: be49b5586153ec38334fe64e8b41cb4b4871ea34 [file] [log] [blame]
Zhenkai Zhuaca6cb52013-02-24 23:34:03 -08001#include "sparkle-auto-update.h"
2#import <Sparkle/Sparkle.h>
3
4class SparkleAutoUpdate::Private
5{
6 public:
7 SUUpdater *updater;
8};
9
10SparkleAutoUpdate::SparkleAutoUpdate(const QString &updateUrl)
11{
12 d = new Private;
13 d->updater = [SUUpdater sharedUpdater];
14 [d->updater setAutomaticallyChecksForUpdates:YES];
15 NSURL *url = [NSURL URLWithString: [NSString stringWithUTF8String: updateUrl.toUtf8().data()]];
16 [d->updater setFeedURL: url];
17}
18
19SparkleAutoUpdate::~SparkleAutoUpdate()
20{
21 delete d;
22 // presummably SUUpdater handles garbage collection
23}
24
25void SparkleAutoUpdate::checkForUpdates()
26{
27 [d->updater checkForUpdatesInBackground];
28}