2261
|
1 |
/*
|
|
2 |
* Copyright (C) 2008 Remko Troncon
|
|
3 |
*/
|
|
4 |
|
|
5 |
#include "SparkleAutoUpdater.h"
|
|
6 |
|
|
7 |
#include <Cocoa/Cocoa.h>
|
|
8 |
#include <Sparkle/Sparkle.h>
|
|
9 |
|
|
10 |
class SparkleAutoUpdater::Private
|
|
11 |
{
|
|
12 |
public:
|
|
13 |
SUUpdater* updater;
|
|
14 |
};
|
|
15 |
|
|
16 |
SparkleAutoUpdater::SparkleAutoUpdater(const QString& aUrl)
|
|
17 |
{
|
|
18 |
d = new Private;
|
|
19 |
|
|
20 |
d->updater = [SUUpdater sharedUpdater];
|
|
21 |
[d->updater retain];
|
|
22 |
|
|
23 |
NSURL* url = [NSURL URLWithString:
|
|
24 |
[NSString stringWithUTF8String: aUrl.toUtf8().data()]];
|
|
25 |
[d->updater setFeedURL: url];
|
|
26 |
}
|
|
27 |
|
|
28 |
SparkleAutoUpdater::~SparkleAutoUpdater()
|
|
29 |
{
|
|
30 |
[d->updater release];
|
|
31 |
delete d;
|
|
32 |
}
|
|
33 |
|
|
34 |
void SparkleAutoUpdater::checkForUpdates()
|
|
35 |
{
|
|
36 |
[d->updater checkForUpdatesInBackground];
|
|
37 |
}
|