131 inline void log(
const QString &str1,
const QString &str2 = QString(),
const QString &str3 = QString(),
const QString &str4 = QString());
42 bool isComplete(
void);
44 const quint32 &getBuildNo(
void)
const {
return m_buildNo; }
45 const QDate &getBuildDate(
void)
const {
return m_buildDate; }
46 const QString &getDownloadSite(
void)
const {
return m_downloadSite; }
47 const QString &getDownloadAddress(
void)
const {
return m_downloadAddress; }
48 const QString &getDownloadFilename(
void)
const {
return m_downloadFilename; }
49 const QString &getDownloadFilecode(
void)
const {
return m_downloadFilecode; }
50 const QString &getDownloadChecksum(
void)
const {
return m_downloadChecksum; }
55 QString m_downloadSite;
56 QString m_downloadAddress;
57 QString m_downloadFilename;
58 QString m_downloadFilecode;
59 QString m_downloadChecksum;
71 UpdateStatus_NotStartedYet = 0,
72 UpdateStatus_CheckingConnection = 1,
73 UpdateStatus_FetchingUpdates = 2,
74 UpdateStatus_CompletedUpdateAvailable = 3,
75 UpdateStatus_CompletedNoUpdates = 4,
76 UpdateStatus_CompletedNewVersionOlder = 5,
77 UpdateStatus_ErrorNoConnection = 6,
78 UpdateStatus_ErrorConnectionTestFailed = 7,
79 UpdateStatus_ErrorFetchUpdateInfo = 8,
80 UpdateStatus_CancelledByUser = 9
84 UpdateChecker(
const QString &binWGet,
const QString &binMCat,
const QString &binGnuPG,
const QString &binKeys,
const QString &applicationId,
const quint32 &installedBuildNo,
const bool betaUpdates,
const bool testMode =
false);
87 const int getUpdateStatus(
void)
const {
return m_status; }
88 const bool getSuccess(
void)
const {
return m_success; };
89 const int getMaximumProgress(
void)
const {
return m_maxProgress; };
90 const int getCurrentProgress(
void)
const {
return m_progress; };
91 const UpdateCheckerInfo *getUpdateInfo(
void)
const {
return m_updateInfo.data(); }
93 bool cancel(
void) {
return m_cancelled.ref(); }
96 void start(Priority = InheritPriority);
100 void checkForUpdates(
void);
101 void testKnownHosts(
void);
104 void statusChanged(
const int status);
105 void progressChanged(
const int progress);
106 void messageLogged(
const QString &text);
109 const int m_maxProgress;
110 QScopedPointer<UpdateCheckerInfo> m_updateInfo;
112 const bool m_betaUpdates;
113 const bool m_testMode;
115 const QString m_applicationId;
116 const quint32 m_installedBuildNo;
118 const QString m_binaryWGet;
119 const QString m_binaryMCat;
120 const QString m_binaryGnuPG;
121 const QString m_binaryKeys;
123 QAtomicInt m_success;
124 QAtomicInt m_cancelled;
129 inline void setStatus(
const int status);
130 inline void setProgress(
const int progress);
131 inline void log(
const QString &str1,
const QString &str2 = QString(),
const QString &str3 = QString(),
const QString &str4 = QString());
133 bool getUpdateInfo(
const QString &url,
const QString &outFileVers,
const QString &outFileSign);
134 bool tryContactHost(
const QString &hostname,
const int &timeoutMsec, quint32 *
const ipAddrOut = NULL);
137 bool getFile(
const QString &url,
const QString &outFile,
const unsigned int maxRedir = 5U);
138 bool getFile(
const QString &url,
const bool forceIp4,
const QString &outFile,
const unsigned int maxRedir = 5U);
139 bool checkSignature(
const QString &file,
const QString &signature);
140 bool tryUpdateMirror(
UpdateCheckerInfo *updateInfo,
const QString &url,
const bool &quick);
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Definition: UpdateChecker.h:35
Global MUtils namespace.
Definition: CPUFeatures.h:37
Definition: UpdateChecker.h:64