1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-22 04:37:46 +00:00
astra/launcher/include/assetupdater.h

63 lines
1.5 KiB
C
Raw Normal View History

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
2022-08-15 11:14:37 -04:00
#include <QJsonArray>
#include <QObject>
2022-08-15 11:14:37 -04:00
#include <QTemporaryDir>
#include "launchercore.h"
class LauncherCore;
class QNetworkReply;
class AssetUpdater : public QObject
{
Q_OBJECT
2023-09-17 08:32:47 -04:00
public:
explicit AssetUpdater(Profile &profile, LauncherCore &launcher, QObject *parent = nullptr);
void update();
void beginInstall();
void checkIfCheckingIsDone();
void checkIfDalamudAssetsDone();
void checkIfFinished();
2023-09-17 08:32:47 -04:00
Q_SIGNALS:
void finishedUpdating();
private:
2023-09-17 09:02:11 -04:00
[[nodiscard]] QUrl dalamudVersionManifestUrl(Profile::DalamudChannel channel) const;
[[nodiscard]] QUrl dalamudLatestPackageUrl(Profile::DalamudChannel channel) const;
[[nodiscard]] QUrl dalamudAssetManifestUrl() const;
LauncherCore &launcher;
Profile::DalamudChannel chosenChannel;
2022-01-27 10:46:22 -05:00
QString remoteDalamudVersion;
QString remoteRuntimeVersion;
2022-01-27 10:46:22 -05:00
QTemporaryDir tempDir;
QDir dataDir;
QDir appDataDir;
QDir dalamudDir;
QDir dalamudAssetDir;
QDir dalamudRuntimeDir;
bool doneDownloadingDalamud = false;
bool doneDownloadingRuntimeCore = false;
bool doneDownloadingRuntimeDesktop = false;
bool needsRuntimeInstall = false;
bool needsDalamudInstall = false;
int remoteDalamudAssetVersion = -1;
QList<QString> dalamudAssetNeededFilenames;
QJsonArray remoteDalamudAssetArray;
Profile &m_profile;
2022-01-27 10:46:22 -05:00
};