QTfrontend/util/platform/SparkleAutoUpdater.mm
changeset 8381 588a8e6e2041
parent 8064 202e2cce7077
child 9080 9b42757d7e71
equal deleted inserted replaced
8380:0b375a3ceaa0 8381:588a8e6e2041
       
     1 /*
       
     2  * Hedgewars, a free turn based strategy game
       
     3  * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
       
     4  *
       
     5  * This program is free software; you can redistribute it and/or modify
       
     6  * it under the terms of the GNU General Public License as published by
       
     7  * the Free Software Foundation; version 2 of the License
       
     8  *
       
     9  * This program is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12  * GNU General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU General Public License
       
    15  * along with this program; if not, write to the Free Software
       
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
       
    17  */
       
    18 
       
    19 // see original example here http://el-tramo.be/blog/mixing-cocoa-and-qt
       
    20 
       
    21 #include "SparkleAutoUpdater.h"
       
    22 
       
    23 #include <Cocoa/Cocoa.h>
       
    24 #include <Sparkle/Sparkle.h>
       
    25 
       
    26 class SparkleAutoUpdater::Private
       
    27 {
       
    28     public:
       
    29         SUUpdater* updater;
       
    30 };
       
    31 
       
    32 SparkleAutoUpdater::SparkleAutoUpdater()
       
    33 {
       
    34     d = new SparkleAutoUpdater::Private();
       
    35 
       
    36     d->updater = [SUUpdater sharedUpdater];
       
    37     [d->updater retain];
       
    38 }
       
    39 
       
    40 SparkleAutoUpdater::~SparkleAutoUpdater()
       
    41 {
       
    42     [d->updater release];
       
    43     delete d;
       
    44 }
       
    45 
       
    46 void SparkleAutoUpdater::checkForUpdates()
       
    47 {
       
    48     [d->updater checkForUpdatesInBackground];
       
    49 }
       
    50 
       
    51 void SparkleAutoUpdater::checkForUpdatesNow()
       
    52 {
       
    53     [d->updater checkForUpdates:NULL];
       
    54 }