10#ifndef SOFTWARE_UPDATE_H
11#define SOFTWARE_UPDATE_H
17#include <QVersionNumber>
19class QNetworkAccessManager;
53 bool accepted_ =
false;
54 bool rejected_ =
false;
111 void init(
bool runWithoutSilentCheck =
false);
133 static QString
info();
199 static QMutex mutex_;
200 static QMutex updateMutex_;
202 QTimer *updateCheckTimer_;
203 QNetworkAccessManager *networkAccessManager_;
209 QUrl updateUrl()
const;
216 QList<AppcastItem> parseAppcast(
const QByteArray &data)
const;
224 static int __cdecl softwareUpdateCanShutdownCallback();
229 static void __cdecl shutdownRequestCallback();
234 static void __cdecl softwareUpdateEngaged();
236#elif defined(__APPLE__)
243 static void onPostponeRelaunch(
void (*proceed)(
void *ctx),
void *ctx);
251 void onNetworkReplyFinished(QNetworkReply *reply);
258 void checkForUpdates();
An event object passed to shutdown listeners to allow vetoing.
Definition software_update.h:25
QString reason() const
Return the reason provided to the most recent reject() call.
Definition software_update.cpp:90
void accept()
Signal that this listener consents to the shutdown.
Definition software_update.cpp:74
bool isAccepted() const
Return whether the shutdown has been accepted.
Definition software_update.cpp:86
void reject(const QString &reason={})
Veto the shutdown with an optional explanatory message.
Definition software_update.cpp:80
The SoftwareUpdate class provides an interface for checking for software updates and engaging the upd...
Definition software_update.h:86
void stopAutoCheck()
Stop the periodic automatic update check.
Definition software_update.cpp:315
static void performUIUpdate()
Definition software_update.cpp:265
void updateCheckFailed(const QString &errorString)
Emitted when the update check fails.
void updateAvailable(QString newVersion, QString releaseNotes)
Emitted when a new software update is available.
static bool plattformSupported()
Definition software_update.cpp:219
SoftwareUpdate & operator=(const SoftwareUpdate &)=delete
Deleted copy-assignment operator — SoftwareUpdate is a singleton.
void appShutdownRequested(ShutdownEvent *shutdownEvent)
Emitted when the application requests a shutdown to perform an update.
static SoftwareUpdate * instance()
Return the singleton SoftwareUpdate instance.
Definition software_update.cpp:115
void init(bool runWithoutSilentCheck=false)
Definition software_update.cpp:125
~SoftwareUpdate()
Destroy the SoftwareUpdate singleton and release all resources.
Definition software_update.cpp:110
void startAutoCheck(int intervalSeconds=0)
Start the periodic automatic update check.
Definition software_update.cpp:289
static QString info()
Definition software_update.cpp:204
void updateEngaged()
Emitted when the update process is engaged.
void cleanup()
Definition software_update.cpp:281
bool isAutoCheckEnabled() const
Return whether the periodic automatic update check is enabled.
Definition software_update.cpp:324
SoftwareUpdate(const SoftwareUpdate &)=delete
Deleted copy constructor — SoftwareUpdate is a singleton.
A single entry from a Sparkle-compatible appcast feed.
Definition software_update.h:61
QUrl releaseNotesUrl
Definition software_update.h:66
QVersionNumber shortVersion
Definition software_update.h:64
qint64 length
Definition software_update.h:70
QVersionNumber version
Definition software_update.h:63
QString title
Definition software_update.h:62
QString edSignature
Definition software_update.h:71
QString os
Definition software_update.h:69
QUrl downloadUrl
Definition software_update.h:65