QTfrontend/SparkleAutoUpdater.mm
author smaxx
Fri, 17 Sep 2010 15:27:04 +0200
changeset 3871 c91aefe1dca2
parent 2261 57e99c908e7c
child 5095 15dd764b728c
permissions -rw-r--r--
Frontend: * Disabled frontend's hog count for now to fix issue #44 - doesn't have to be limited to 48 anyway (but a limit based on active map would be nice)

/*
 * Copyright (C) 2008 Remko Troncon
 */

#include "SparkleAutoUpdater.h"

#include <Cocoa/Cocoa.h>
#include <Sparkle/Sparkle.h>

class SparkleAutoUpdater::Private
{
	public:
		SUUpdater* updater;
};

SparkleAutoUpdater::SparkleAutoUpdater(const QString& aUrl)
{
	d = new Private;

	d->updater = [SUUpdater sharedUpdater];
	[d->updater retain];

	NSURL* url = [NSURL URLWithString:
			[NSString stringWithUTF8String: aUrl.toUtf8().data()]];
	[d->updater setFeedURL: url];
}

SparkleAutoUpdater::~SparkleAutoUpdater()
{
	[d->updater release];
	delete d;
}

void SparkleAutoUpdater::checkForUpdates()
{
	[d->updater checkForUpdatesInBackground];
}