2023-08-05 22:14:05 -04:00
|
|
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-11-23 14:37:37 -05:00
|
|
|
#pragma once
|
|
|
|
|
2022-08-15 11:14:37 -04:00
|
|
|
#include <QJsonArray>
|
2021-11-23 14:37:37 -05:00
|
|
|
#include <QObject>
|
2022-08-15 11:14:37 -04:00
|
|
|
#include <QTemporaryDir>
|
2021-11-23 14:37:37 -05:00
|
|
|
|
2022-04-13 10:45:00 -04:00
|
|
|
#include "launchercore.h"
|
|
|
|
|
2021-11-23 15:34:23 -05:00
|
|
|
class LauncherCore;
|
2021-11-23 14:37:37 -05:00
|
|
|
class QNetworkReply;
|
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
class AssetUpdater : public QObject
|
|
|
|
{
|
2021-11-23 14:37:37 -05:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-07-30 08:49:34 -04:00
|
|
|
explicit AssetUpdater(Profile &profile, LauncherCore &launcher, QObject *parent = nullptr);
|
2021-11-23 14:37:37 -05:00
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
void update();
|
2021-11-23 14:37:37 -05:00
|
|
|
void beginInstall();
|
|
|
|
|
2022-03-13 20:44:57 -04:00
|
|
|
void checkIfCheckingIsDone();
|
2022-02-25 18:08:57 -05:00
|
|
|
void checkIfDalamudAssetsDone();
|
|
|
|
void checkIfFinished();
|
|
|
|
|
2021-11-23 14:37:37 -05:00
|
|
|
signals:
|
|
|
|
void finishedUpdating();
|
|
|
|
|
|
|
|
private:
|
2023-08-18 21:36:29 -04:00
|
|
|
QUrl dalamudVersionManifestUrl(Profile::DalamudChannel channel) const;
|
|
|
|
QUrl dalamudLatestPackageUrl(Profile::DalamudChannel channel) const;
|
|
|
|
QUrl dalamudAssetManifestUrl() const;
|
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
LauncherCore &launcher;
|
2021-11-23 14:37:37 -05:00
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
Profile::DalamudChannel chosenChannel;
|
2022-01-27 10:46:22 -05:00
|
|
|
|
|
|
|
QString remoteDalamudVersion;
|
2022-02-25 20:06:29 -05:00
|
|
|
QString remoteRuntimeVersion;
|
2022-01-27 10:46:22 -05:00
|
|
|
|
2021-11-23 14:37:37 -05:00
|
|
|
QTemporaryDir tempDir;
|
2023-08-18 14:52:06 -04:00
|
|
|
QDir dataDir;
|
|
|
|
QDir appDataDir;
|
|
|
|
QDir dalamudDir;
|
|
|
|
QDir dalamudAssetDir;
|
|
|
|
QDir dalamudRuntimeDir;
|
2022-02-25 18:08:57 -05:00
|
|
|
|
2022-04-08 19:34:51 -04:00
|
|
|
bool doneDownloadingDalamud = false;
|
|
|
|
bool doneDownloadingRuntimeCore = false;
|
|
|
|
bool doneDownloadingRuntimeDesktop = false;
|
2022-02-25 20:06:29 -05:00
|
|
|
bool needsRuntimeInstall = false;
|
|
|
|
bool needsDalamudInstall = false;
|
2022-02-25 18:08:57 -05:00
|
|
|
|
2022-03-13 20:44:57 -04:00
|
|
|
int remoteDalamudAssetVersion = -1;
|
2022-02-25 18:08:57 -05:00
|
|
|
QList<QString> dalamudAssetNeededFilenames;
|
2022-03-13 20:44:57 -04:00
|
|
|
QJsonArray remoteDalamudAssetArray;
|
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
Profile &m_profile;
|
2022-01-27 10:46:22 -05:00
|
|
|
};
|