1*431d01deSNicolas Bonnefon /* 2*431d01deSNicolas Bonnefon * Copyright (C) 2014 Nicolas Bonnefon and other contributors 3*431d01deSNicolas Bonnefon * 4*431d01deSNicolas Bonnefon * This file is part of glogg. 5*431d01deSNicolas Bonnefon * 6*431d01deSNicolas Bonnefon * glogg is free software: you can redistribute it and/or modify 7*431d01deSNicolas Bonnefon * it under the terms of the GNU General Public License as published by 8*431d01deSNicolas Bonnefon * the Free Software Foundation, either version 3 of the License, or 9*431d01deSNicolas Bonnefon * (at your option) any later version. 10*431d01deSNicolas Bonnefon * 11*431d01deSNicolas Bonnefon * glogg is distributed in the hope that it will be useful, 12*431d01deSNicolas Bonnefon * but WITHOUT ANY WARRANTY; without even the implied warranty of 13*431d01deSNicolas Bonnefon * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14*431d01deSNicolas Bonnefon * GNU General Public License for more details. 15*431d01deSNicolas Bonnefon * 16*431d01deSNicolas Bonnefon * You should have received a copy of the GNU General Public License 17*431d01deSNicolas Bonnefon * along with glogg. If not, see <http://www.gnu.org/licenses/>. 18*431d01deSNicolas Bonnefon */ 19*431d01deSNicolas Bonnefon 20*431d01deSNicolas Bonnefon #include "versionchecker.h" 21*431d01deSNicolas Bonnefon 22*431d01deSNicolas Bonnefon #include "log.h" 23*431d01deSNicolas Bonnefon 24*431d01deSNicolas Bonnefon const char* VersionChecker::VERSION_URL = 25*431d01deSNicolas Bonnefon "http://gloggversion.bonnefon.org/latest"; 26*431d01deSNicolas Bonnefon 27*431d01deSNicolas Bonnefon VersionChecker::VersionChecker() : QObject(), manager_( this ) 28*431d01deSNicolas Bonnefon { 29*431d01deSNicolas Bonnefon } 30*431d01deSNicolas Bonnefon 31*431d01deSNicolas Bonnefon VersionChecker::~VersionChecker() 32*431d01deSNicolas Bonnefon { 33*431d01deSNicolas Bonnefon } 34*431d01deSNicolas Bonnefon 35*431d01deSNicolas Bonnefon void VersionChecker::startCheck() 36*431d01deSNicolas Bonnefon { 37*431d01deSNicolas Bonnefon LOG(logDEBUG) << "VersionChecker::startCheck()"; 38*431d01deSNicolas Bonnefon 39*431d01deSNicolas Bonnefon connect( &manager_, SIGNAL( finished( QNetworkReply* ) ), 40*431d01deSNicolas Bonnefon this, SLOT( downloadFinished( QNetworkReply* ) ) ); 41*431d01deSNicolas Bonnefon 42*431d01deSNicolas Bonnefon QNetworkRequest request; 43*431d01deSNicolas Bonnefon request.setUrl( QUrl( VERSION_URL ) ); 44*431d01deSNicolas Bonnefon request.setRawHeader( "User-Agent", "glogg-" GLOGG_VERSION ); 45*431d01deSNicolas Bonnefon manager_.get( request ); 46*431d01deSNicolas Bonnefon } 47*431d01deSNicolas Bonnefon 48*431d01deSNicolas Bonnefon void VersionChecker::downloadFinished( QNetworkReply* reply ) 49*431d01deSNicolas Bonnefon { 50*431d01deSNicolas Bonnefon LOG(logDEBUG) << "VersionChecker::downloadFinished()"; 51*431d01deSNicolas Bonnefon } 52