added local updater, minor fixes
tests / package-smoke-linux (push) Skipped
tests / package-smoke-windows (push) Skipped
tests / package-smoke-macos (push) Skipped
tests / macos (push) Successful in 1m24s
tests / windows (pull_request) Skipped
tests / macos (pull_request) Skipped
tests / package-smoke-linux (pull_request) Skipped
tests / package-smoke-windows (pull_request) Skipped
tests / package-smoke-macos (pull_request) Skipped
tests / linux (push) Failing after 1m37s
tests / linux (pull_request) Failing after 1m39s
tests / windows (push) Canceled after 0s
tests / package-smoke-linux (push) Skipped
tests / package-smoke-windows (push) Skipped
tests / package-smoke-macos (push) Skipped
tests / macos (push) Successful in 1m24s
tests / windows (pull_request) Skipped
tests / macos (pull_request) Skipped
tests / package-smoke-linux (pull_request) Skipped
tests / package-smoke-windows (pull_request) Skipped
tests / package-smoke-macos (pull_request) Skipped
tests / linux (push) Failing after 1m37s
tests / linux (pull_request) Failing after 1m39s
tests / windows (push) Canceled after 0s
Signed-off-by: galeon <dertiellis@gmail.com>
This commit is contained in:
1 parent
98344a1870
commit
d4a17a4561
10 files changed
+777
-31
No files matched your search
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QTemporaryDir>
|
||||
#include <QVariantMap>
|
||||
#include <QtQml/qqmlregistration.h>
|
||||
#include <memory>
|
||||
|
||||
class QFile;
|
||||
|
||||
class LauncherUpdates : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
QML_ELEMENT
|
||||
Q_PROPERTY(QString channel READ channel CONSTANT)
|
||||
Q_PROPERTY(QVariantMap catalogs READ catalogs NOTIFY catalogChanged)
|
||||
Q_PROPERTY(QVariantMap states READ states NOTIFY catalogChanged)
|
||||
Q_PROPERTY(QString latest READ latest NOTIFY catalogChanged)
|
||||
Q_PROPERTY(bool installing READ installing NOTIFY installationChanged)
|
||||
|
||||
public:
|
||||
explicit LauncherUpdates(QObject *parent = nullptr);
|
||||
~LauncherUpdates() override;
|
||||
|
||||
QString channel() const;
|
||||
QVariantMap catalogs() const { return m_catalogs; }
|
||||
QVariantMap states() const { return m_states; }
|
||||
QString latest() const { return m_latest; }
|
||||
bool installing() const { return bool(m_download); }
|
||||
|
||||
Q_INVOKABLE void refresh(const QString &channel);
|
||||
Q_INVOKABLE void install(const QString &channel, const QString &version);
|
||||
|
||||
signals:
|
||||
void catalogChanged();
|
||||
void installationChanged();
|
||||
void installationFailed();
|
||||
|
||||
private:
|
||||
void fetchPage(const QString &channel, int page, QVariantList entries);
|
||||
bool startInstallation(const QString &path);
|
||||
|
||||
QNetworkAccessManager m_network;
|
||||
QVariantMap m_catalogs;
|
||||
QVariantMap m_states;
|
||||
QString m_latest;
|
||||
std::unique_ptr<QTemporaryDir> m_temp;
|
||||
std::unique_ptr<QFile> m_download;
|
||||
};
|
||||
Reference in new issue
Block a user