mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-21 20:27:45 +00:00
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.
42 lines
No EOL
955 B
C++
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;
|
|
}; |