QTfrontend/SparkleAutoUpdater.mm
author sheepluva
Thu, 27 Jan 2011 22:55:11 +0100
branch0.9.15
changeset 4771 6bb64d38003e
parent 2261 57e99c908e7c
child 5095 15dd764b728c
permissions -rw-r--r--
how about we 60-sec-ban the _kicked user_ instead of the _admin that kicked that user_? :P
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2261
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     1
/*
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     2
 * Copyright (C) 2008 Remko Troncon
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     3
 */
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     4
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     5
#include "SparkleAutoUpdater.h"
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     6
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     7
#include <Cocoa/Cocoa.h>
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     8
#include <Sparkle/Sparkle.h>
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
     9
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    10
class SparkleAutoUpdater::Private
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    11
{
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    12
	public:
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    13
		SUUpdater* updater;
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    14
};
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    15
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    16
SparkleAutoUpdater::SparkleAutoUpdater(const QString& aUrl)
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    17
{
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    18
	d = new Private;
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    19
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    20
	d->updater = [SUUpdater sharedUpdater];
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    21
	[d->updater retain];
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    22
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    23
	NSURL* url = [NSURL URLWithString:
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    24
			[NSString stringWithUTF8String: aUrl.toUtf8().data()]];
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    25
	[d->updater setFeedURL: url];
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    26
}
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    27
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    28
SparkleAutoUpdater::~SparkleAutoUpdater()
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    29
{
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    30
	[d->updater release];
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    31
	delete d;
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    32
}
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    33
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    34
void SparkleAutoUpdater::checkForUpdates()
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    35
{
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    36
	[d->updater checkForUpdatesInBackground];
57e99c908e7c a lot of stuff:
koda
parents:
diff changeset
    37
}