Blame toonz/sources/include/toonzqt/updatechecker.h
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef UPDATE_CHECKER_H
|
|
Toshihiro Shimizu |
890ddd |
#define UPDATE_CHECKER_H
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include <qtglobal></qtglobal>
|
|
Toshihiro Shimizu |
890ddd |
#include <qobject></qobject>
|
|
Toshihiro Shimizu |
890ddd |
#include "tcommon.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#if QT_VERSION >= 0x050000
|
|
Toshihiro Shimizu |
890ddd |
#include <qnetworkaccessmanager></qnetworkaccessmanager>
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
#include <qhttp></qhttp>
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
#include <qurl></qurl>
|
|
Toshihiro Shimizu |
890ddd |
#include <qstring></qstring>
|
|
Toshihiro Shimizu |
890ddd |
#include <qdate></qdate>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#undef DVAPI
|
|
Toshihiro Shimizu |
890ddd |
#undef DVVAR
|
|
Toshihiro Shimizu |
890ddd |
#ifdef TOONZQT_EXPORTS
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_EXPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_EXPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_IMPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_IMPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI UpdateChecker
|
|
Toshihiro Shimizu |
890ddd |
#if QT_VERSION < 0x050000
|
|
Toshihiro Shimizu |
890ddd |
: public QHttp
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
: public QObject
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
Q_OBJECT
|
|
Toshihiro Shimizu |
890ddd |
bool m_httpRequestAborted;
|
|
Toshihiro Shimizu |
890ddd |
int m_httpGetId;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QDate m_updateDate;
|
|
Toshihiro Shimizu |
890ddd |
QUrl m_webPageUrl;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
UpdateChecker(const QString &requestToServer);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
QDate getUpdateDate() const { return m_updateDate; }
|
|
Toshihiro Shimizu |
890ddd |
QUrl getWebPageUrl() const { return m_webPageUrl; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
protected slots:
|
|
Toshihiro Shimizu |
890ddd |
void httpRequestStarted(int requestId) {}
|
|
Toshihiro Shimizu |
890ddd |
#if QT_VERSION >= 0x050000
|
|
Toshihiro Shimizu |
890ddd |
void httpRequestFinished(QNetworkReply *);
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
void httpRequestFinished(int requestId, bool error);
|
|
Toshihiro Shimizu |
890ddd |
void readyReadExec(const QHttpResponseHeader &head) {}
|
|
Toshihiro Shimizu |
890ddd |
void readResponseHeader(const QHttpResponseHeader &responseHeader);
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
void slotAuthenticationRequired(const QString &hostName, quint16, QAuthenticator *authenticator);
|
|
Toshihiro Shimizu |
890ddd |
void httpStateChanged(int state);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif // UPDATE_CHECKER_H
|