1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 20:27:45 +00:00
astra/launcher/include/patcher.h
Joshua Goins 16420b7421 Complete rewrite to Kirigami
Giant commit overhauling the interface to use KDE's Kirigami framework,
which is based on Qt Quick. The logic is all but rewritten, allowing
accounts to be separate from profiles.
2023-07-30 08:49:34 -04:00

42 lines
No EOL
955 B
C++

#pragma once
#include <QNetworkAccessManager>
#include <QString>
#include <physis.hpp>
// General-purpose patcher routine. It opens a nice dialog box, handles downloading
// and processing patches.
class Patcher : public QObject
{
Q_OBJECT
public:
Patcher(QString baseDirectory, GameData *game_data, QObject *parent = nullptr);
Patcher(QString baseDirectory, BootData *game_data, QObject *parent = nullptr);
void processPatchList(QNetworkAccessManager &mgr, const QString &patchList);
signals:
void done();
private:
void checkIfDone();
[[nodiscard]] bool isBoot() const
{
return boot_data != nullptr;
}
struct QueuedPatch {
QString name, repository, version, path;
};
void processPatch(const QueuedPatch &patch);
QVector<QueuedPatch> patchQueue;
QString baseDirectory;
BootData *boot_data = nullptr;
GameData *game_data = nullptr;
int remainingPatches = -1;
};