10#ifndef SOFTWARE_UPDATE_H
11#define SOFTWARE_UPDATE_H
16#include <QScopedPointer>
18#include <QVersionNumber>
20class QNetworkAccessManager;
55 bool accepted_ =
false;
56 bool rejected_ =
false;
113 void init(
bool runWithoutSilentCheck =
false);
135 static QString
info();
201 static QMutex mutex_;
202 static QMutex updateMutex_;
204 QTimer *updateCheckTimer_;
205 QNetworkAccessManager *networkAccessManager_;
206 QScopedPointer<SoftwareUpdateBackend> backend_;
207 QNetworkReply *pendingReply_ =
nullptr;
213 QUrl updateUrl()
const;
220 QList<AppcastItem> parseAppcast(
const QByteArray &data)
const;
228 void onNetworkReplyFinished(QNetworkReply *reply);
235 void checkForUpdates();
An event object passed to shutdown listeners to allow vetoing.
Definition software_update.h:27
QString reason() const
Return the reason provided to the most recent reject() call.
Definition software_update.cpp:70
void accept()
Signal that this listener consents to the shutdown.
Definition software_update.cpp:54
bool isAccepted() const
Return whether the shutdown has been accepted.
Definition software_update.cpp:66
void reject(const QString &reason={})
Veto the shutdown with an optional explanatory message.
Definition software_update.cpp:60
Definition software_update_backend.h:31
void stopAutoCheck()
Stop the periodic automatic update check.
Definition software_update.cpp:233
static void performUIUpdate()
Definition software_update.cpp:187
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:138
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:96
void init(bool runWithoutSilentCheck=false)
Definition software_update.cpp:106
~SoftwareUpdate()
Destroy the SoftwareUpdate singleton and release all resources.
Definition software_update.cpp:91
void startAutoCheck(int intervalSeconds=0)
Start the periodic automatic update check.
Definition software_update.cpp:208
static QString info()
Definition software_update.cpp:131
void updateEngaged()
Emitted when the update process is engaged.
void cleanup()
Definition software_update.cpp:200
bool isAutoCheckEnabled() const
Return whether the periodic automatic update check is enabled.
Definition software_update.cpp:242
SoftwareUpdate(const SoftwareUpdate &)=delete
Deleted copy constructor — SoftwareUpdate is a singleton.
A single entry from a Sparkle-compatible appcast feed.
Definition software_update.h:63
QUrl releaseNotesUrl
Definition software_update.h:68
QVersionNumber shortVersion
Definition software_update.h:66
qint64 length
Definition software_update.h:72
QVersionNumber version
Definition software_update.h:65
QString title
Definition software_update.h:64
QString edSignature
Definition software_update.h:73
QString os
Definition software_update.h:71
QUrl downloadUrl
Definition software_update.h:67