HulaLoop
Simple cross-platform audio loopback and recording.
Updater.h
1 #ifndef HL_UPDATER_H
2 #define HL_UPDATER_H
3 
4 #include <HulaVersion.h>
5 
6 #include <QFile>
7 #include <QNetworkAccessManager>
8 #include <QNetworkReply>
9 #include <QObject>
10 
11 namespace hula
12 {
13  class Updater : public QObject {
14  Q_OBJECT
15 
19  Q_PROPERTY(QString updateHostUrl READ getUpdateHost WRITE setUpdateHost)
20 
21 
24  Q_PROPERTY(qint64 downloadSize READ getDownloadSize)
25 
29  Q_PROPERTY(qint64 numBytesDownloaded READ getNumBytesDownloaded)
30 
31  private:
32  QNetworkAccessManager *manager;
33  QNetworkReply *reply;
34 
35  QString errorMsg;
36  QString updateHostUrl;
37  QString downloadHostUrl;
38  QString downloadFileName;
39 
40  qint64 numBytesDownloaded;
41  qint64 downloadSize;
42 
43  public:
44  explicit Updater(QObject *parent = nullptr);
45  ~Updater();
46 
47  void setUpdateHost(QString);
48  QString getUpdateHost();
49 
50  QString getDownloadFileName();
51  qint64 getNumBytesDownloaded();
52  qint64 getDownloadSize();
53 
54  QList<int> parseTagName(const QString &);
55 
56  Q_INVOKABLE QString getErrorMessage();
57  Q_INVOKABLE int checkForUpdate();
58  Q_INVOKABLE int downloadUpdate();
59 
60  Q_INVOKABLE void startHulaLoopInstaller();
61  Q_INVOKABLE void startHulaLoopApp();
62 
63  signals:
70  void bytesDownloaded();
71  };
72 }
73 
74 #endif // HL_UPDATER_H
QString getDownloadFileName()
Method to check the downloaded file name.
Definition: Updater.cpp:63
void setUpdateHost(QString)
Sets the update host for the Updater.
Definition: Updater.cpp:43
Q_INVOKABLE void startHulaLoopInstaller()
Opens the HulaLoop installer application.
Definition: Updater.cpp:306
qint64 getNumBytesDownloaded()
Method to check how many bytes have been downloaded.
Definition: Updater.cpp:73
Definition: Updater.h:13
Q_INVOKABLE int downloadUpdate()
Creates the network request using the downloadHostUrl.
Definition: Updater.cpp:236
QList< int > parseTagName(const QString &)
A method to parse the tag name returned from the GitHub Releases API.
Definition: Updater.cpp:94
qint64 getDownloadSize()
Method to check the size of the download.
Definition: Updater.cpp:83
QString getUpdateHost()
Method to check the downloaded file name.
Definition: Updater.cpp:53
Wrapper around translation functions for Qt.
Definition: Controller.h:10
qint64 numBytesDownloaded
Exposes the numBytesDownloaded property to QML.
Definition: Updater.h:29
QString updateHostUrl
Exposes the updateHostUrl property to QML.
Definition: Updater.h:19
Q_INVOKABLE void startHulaLoopApp()
Opens the HulaLoop application.
Definition: Updater.cpp:322
void bytesDownloaded()
A signal emitted when QNetworkReply&#39;s readyRead signal is triggered.
qint64 downloadSize
Exposes the downloadSize property to QML.
Definition: Updater.h:24
Q_INVOKABLE QString getErrorMessage()
Method to check the descriptive error message.
Definition: Updater.cpp:125
Q_INVOKABLE int checkForUpdate()
Creates the network request using the updateHostUrl.
Definition: Updater.cpp:136