44 bool isComplete(
void);
46 const quint32 &getBuildNo(
void)
const {
return m_buildNo; }
47 const QDate &getBuildDate(
void)
const {
return m_buildDate; }
48 const QString &getDownloadSite(
void)
const {
return m_downloadSite; }
49 const QString &getDownloadAddress(
void)
const {
return m_downloadAddress; }
50 const QString &getDownloadFilename(
void)
const {
return m_downloadFilename; }
51 const QString &getDownloadFilecode(
void)
const {
return m_downloadFilecode; }
52 const QString &getDownloadChecksum(
void)
const {
return m_downloadChecksum; }
57 QString m_downloadSite;
58 QString m_downloadAddress;
59 QString m_downloadFilename;
60 QString m_downloadFilecode;
61 QString m_downloadChecksum;
73 UpdateStatus_NotStartedYet = 0,
74 UpdateStatus_CheckingConnection = 1,
75 UpdateStatus_FetchingUpdates = 2,
76 UpdateStatus_CompletedUpdateAvailable = 3,
77 UpdateStatus_CompletedNoUpdates = 4,
78 UpdateStatus_CompletedNewVersionOlder = 5,
79 UpdateStatus_ErrorNoConnection = 6,
80 UpdateStatus_ErrorConnectionTestFailed = 7,
81 UpdateStatus_ErrorFetchUpdateInfo = 8,
82 UpdateStatus_CancelledByUser = 9
86 UpdateChecker(
const QString &binCurl,
const QString &binGnuPG,
const QString &binKeys,
const QString &applicationId,
const quint32 &installedBuildNo,
const bool betaUpdates,
const bool testMode =
false);
89 const int getUpdateStatus(
void)
const {
return m_status; }
90 const bool getSuccess(
void)
const {
return m_success; };
91 const int getMaximumProgress(
void)
const {
return m_maxProgress; };
92 const int getCurrentProgress(
void)
const {
return m_progress; };
93 const UpdateCheckerInfo *getUpdateInfo(
void)
const {
return m_updateInfo.data(); }
95 bool cancel(
void) {
return m_cancelled.ref(); }
98 void start(Priority = InheritPriority);
102 void checkForUpdates(
void);
103 void testMirrorsList(
void);
106 void statusChanged(
const int status);
107 void progressChanged(
const int progress);
108 void messageLogged(
const QString &text);
111 const int m_maxProgress;
112 QScopedPointer<UpdateCheckerInfo> m_updateInfo;
114 const bool m_betaUpdates;
115 const bool m_testMode;
117 const QString m_applicationId;
118 const quint32 m_installedBuildNo;
120 const QString m_binaryCurl;
121 const QString m_binaryGnuPG;
122 const QString m_binaryKeys;
124 const QScopedPointer<const QHash<QString, QString>> m_environment;
126 QAtomicInt m_success;
127 QAtomicInt m_cancelled;
132 inline void setStatus(
const int status);
133 inline void setProgress(
const int progress);
134 inline void log(
const QString &str1,
const QString &str2 = QString(),
const QString &str3 = QString(),
const QString &str4 = QString());
136 bool getUpdateInfo(
const QString &url,
const QString &outFileVers,
const QString &outFileSign);
137 bool tryContactHost(
const QString &hostname,
const int &timeoutMsec);
140 bool getFile(
const QUrl &url,
const QString &outFile,
const unsigned int maxRedir = 8U);
141 bool checkSignature(
const QString &file,
const QString &signature);
142 bool tryUpdateMirror(
UpdateCheckerInfo *updateInfo,
const QString &url,
const bool &quick);
144 bool execCurl(
const QStringList &args,
const QString &workingDir,
const int timeout);
145 int execProcess(
const QString &programFile,
const QStringList &args,
const QString &workingDir,
const int timeout);
This file contains miscellaneous functions that are generally useful for Qt-based applications...
Definition: UpdateChecker.h:37
Global MUtils namespace.
Definition: CPUFeatures.h:37
Definition: UpdateChecker.h:66