#include <liveupdate.h>
Definition at line 16 of file liveupdate.h.
Public Slots | |
void | downloadFile (QString filename, bool xmlprocessing=false, QString filehash="") |
void | cancelDownload () |
void | version () |
void | downloadNew () |
void | handleSslErrors (const QList< QSslError > &e) |
void | gotStateChanged (int i) |
Signals | |
void | CurrentVersion (QString ver) |
void | OnlineVersion (QString ver) |
void | Progress (int percent) |
void | NewVerOK () |
void | stateChanged (int i) |
Public Member Functions | |
LiveUpdate (QObject *parent=0) | |
void | ProcessXml (QFile *file) |
bool | CheckHash (QFile *file, QString *hash) |
bool | runDownloaded (QString args) |
Public Attributes | |
QHttp * | http |
Private Slots | |
void | httpRequestFinished (int requestId, bool error) |
void | readResponseHeader (const QHttpResponseHeader &responseHeader) |
void | updateDataReadProgress (int bytesRead, int totalBytes) |
Private Member Functions | |
void | newHttp () |
Private Attributes | |
QFile * | file |
QString | hash |
QString | newfile |
QString | newhash |
int | httpGetId |
bool | xml |
bool | sucess |
bool | httpRequestAborted |
LiveUpdate::LiveUpdate | ( | QObject * | parent = 0 |
) |
void LiveUpdate::ProcessXml | ( | QFile * | file | ) |
Definition at line 9 of file xmlhandler.cpp.
References QDomElement::attributes(), QDomDocument::documentElement(), newfile, newhash, OnlineVersion(), QFile::open(), QFile::remove(), QDomDocument::setContent(), and QDomElement::text().
Referenced by httpRequestFinished().
Definition at line 177 of file liveupdate.cpp.
References QString::compare(), QFile::fileName(), md5_file(), QString::toAscii(), and uchar.
Referenced by httpRequestFinished().
bool LiveUpdate::runDownloaded | ( | QString | args | ) |
Definition at line 43 of file liveupdate.cpp.
References file, QFile::fileName(), QProcess::startDetached(), and QString::toAscii().
Referenced by LiveUpdateModule::Install().
void LiveUpdate::downloadFile | ( | QString | filename, | |
bool | xmlprocessing = false , |
|||
QString | filehash = "" | |||
) | [slot] |
Definition at line 66 of file liveupdate.cpp.
References file, QHttp::get(), hash, http, httpGetId, httpRequestAborted, newHttp(), QFile::open(), QFile::remove(), QDir::setCurrent(), QHttp::setHost(), QHttp::setUser(), QDir::tempPath(), QString::toAscii(), and xml.
Referenced by LiveUpdateModule::Check(), and downloadNew().
void LiveUpdate::cancelDownload | ( | ) | [slot] |
Definition at line 103 of file liveupdate.cpp.
References QHttp::abort(), http, and httpRequestAborted.
void LiveUpdate::version | ( | ) | [slot] |
Definition at line 51 of file liveupdate.cpp.
References CurrentVersion().
Referenced by LiveUpdateDialog::LiveUpdateDialog().
void LiveUpdate::downloadNew | ( | ) | [slot] |
Definition at line 56 of file liveupdate.cpp.
References downloadFile(), QString::isEmpty(), newfile, and newhash.
Referenced by LiveUpdateModule::Download().
void LiveUpdate::gotStateChanged | ( | int | i | ) | [slot] |
void LiveUpdate::OnlineVersion | ( | QString | ver | ) | [signal] |
Referenced by ProcessXml().
void LiveUpdate::Progress | ( | int | percent | ) | [signal] |
Referenced by updateDataReadProgress().
void LiveUpdate::NewVerOK | ( | ) | [signal] |
Referenced by httpRequestFinished().
void LiveUpdate::stateChanged | ( | int | i | ) | [signal] |
Referenced by gotStateChanged(), and newHttp().
void LiveUpdate::httpRequestFinished | ( | int | requestId, | |
bool | error | |||
) | [private, slot] |
Definition at line 113 of file liveupdate.cpp.
References CheckHash(), QString::clear(), QHttp::close(), QHttp::errorString(), file, QFile::fileName(), hash, http, httpGetId, httpRequestAborted, QString::isEmpty(), NewVerOK(), ProcessXml(), QFile::remove(), sucess, and xml.
Referenced by newHttp().
void LiveUpdate::readResponseHeader | ( | const QHttpResponseHeader & | responseHeader | ) | [private, slot] |
Definition at line 162 of file liveupdate.cpp.
References QHttp::abort(), http, httpRequestAborted, QHttpResponseHeader::reasonPhrase(), and QHttpResponseHeader::statusCode().
Referenced by newHttp().
void LiveUpdate::updateDataReadProgress | ( | int | bytesRead, | |
int | totalBytes | |||
) | [private, slot] |
void LiveUpdate::newHttp | ( | ) | [private] |
Definition at line 14 of file liveupdate.cpp.
References QObject::connect(), gotStateChanged(), handleSslErrors(), http, httpRequestFinished(), readResponseHeader(), stateChanged(), and updateDataReadProgress().
Referenced by downloadFile(), and LiveUpdate().
Definition at line 25 of file liveupdate.h.
Referenced by cancelDownload(), downloadFile(), httpRequestFinished(), LiveUpdate(), newHttp(), and readResponseHeader().
QFile* LiveUpdate::file [private] |
Definition at line 48 of file liveupdate.h.
Referenced by downloadFile(), httpRequestFinished(), and runDownloaded().
QString LiveUpdate::hash [private] |
Definition at line 49 of file liveupdate.h.
Referenced by downloadFile(), and httpRequestFinished().
QString LiveUpdate::newfile [private] |
Definition at line 50 of file liveupdate.h.
Referenced by downloadNew(), LiveUpdate(), and ProcessXml().
QString LiveUpdate::newhash [private] |
Definition at line 51 of file liveupdate.h.
Referenced by downloadNew(), LiveUpdate(), and ProcessXml().
int LiveUpdate::httpGetId [private] |
Definition at line 54 of file liveupdate.h.
Referenced by downloadFile(), and httpRequestFinished().
bool LiveUpdate::xml [private] |
Definition at line 55 of file liveupdate.h.
Referenced by downloadFile(), and httpRequestFinished().
bool LiveUpdate::sucess [private] |
bool LiveUpdate::httpRequestAborted [private] |
Definition at line 57 of file liveupdate.h.
Referenced by cancelDownload(), downloadFile(), httpRequestFinished(), and readResponseHeader().