1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 20:27:45 +00:00

Make some functions const & static

This commit is contained in:
Joshua Goins 2024-08-22 21:02:23 -04:00
parent 0ff1dbd4e5
commit edffbd13dc
7 changed files with 12 additions and 14 deletions

View file

@ -3,7 +3,6 @@
#pragma once #pragma once
#include <QObject>
#include <QtQml> #include <QtQml>
#include <qcorotask.h> #include <qcorotask.h>

View file

@ -28,8 +28,8 @@ private:
QCoro::Task<bool> checkRemoteDalamudAssetVersion(); QCoro::Task<bool> checkRemoteDalamudAssetVersion();
QCoro::Task<bool> checkRemoteDalamudVersion(); QCoro::Task<bool> checkRemoteDalamudVersion();
QCoro::Task<bool> installCompatibilityTool(); QCoro::Task<bool> installCompatibilityTool() const;
QCoro::Task<bool> installDxvkTool(); QCoro::Task<bool> installDxvkTool() const;
QCoro::Task<bool> installDalamudAssets(); QCoro::Task<bool> installDalamudAssets();
QCoro::Task<bool> installDalamud(); QCoro::Task<bool> installDalamud();
QCoro::Task<bool> installRuntime(); QCoro::Task<bool> installRuntime();
@ -39,7 +39,7 @@ private:
[[nodiscard]] QUrl dotnetRuntimePackageUrl(const QString &version) const; [[nodiscard]] QUrl dotnetRuntimePackageUrl(const QString &version) const;
[[nodiscard]] QUrl dotnetDesktopPackageUrl(const QString &version) const; [[nodiscard]] QUrl dotnetDesktopPackageUrl(const QString &version) const;
bool extractZip(const QString &filePath, const QString &directory); static bool extractZip(const QString &filePath, const QString &directory);
LauncherCore &launcher; LauncherCore &launcher;

View file

@ -5,7 +5,7 @@
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QtQml/qqmlregistration.h> #include <QtQml>
class LauncherCore; class LauncherCore;
class Profile; class Profile;

View file

@ -23,11 +23,11 @@ public:
private: private:
/// Checks the gate status to see if the servers are closed for maintenance /// Checks the gate status to see if the servers are closed for maintenance
/// \return False if the gate is closed, true if open. /// \return False if the gate is closed, true if open.
QCoro::Task<bool> checkGateStatus(); QCoro::Task<bool> checkGateStatus() const;
/// Checks the login status to see if the servers are closed for maintenance /// Checks the login status to see if the servers are closed for maintenance
/// \return False if logging in is disabled, true if open. /// \return False if logging in is disabled, true if open.
QCoro::Task<bool> checkLoginStatus(); QCoro::Task<bool> checkLoginStatus() const;
/// Check for updates to the boot components. Even though we don't use these, it's checked by later login steps. /// Check for updates to the boot components. Even though we don't use these, it's checked by later login steps.
QCoro::Task<bool> checkBootUpdates(); QCoro::Task<bool> checkBootUpdates();
@ -46,7 +46,7 @@ private:
QCoro::Task<bool> registerSession(); QCoro::Task<bool> registerSession();
/// Returns the hashes of the boot components /// Returns the hashes of the boot components
QCoro::Task<QString> getBootHash(); QCoro::Task<QString> getBootHash() const;
/// Gets the SHA1 hash of a file /// Gets the SHA1 hash of a file
static QString getFileHash(const QString &file); static QString getFileHash(const QString &file);

View file

@ -203,7 +203,7 @@ QCoro::Task<bool> AssetUpdater::checkRemoteDalamudVersion()
co_return true; co_return true;
} }
QCoro::Task<bool> AssetUpdater::installCompatibilityTool() QCoro::Task<bool> AssetUpdater::installCompatibilityTool() const
{ {
Q_EMIT launcher.stageChanged(i18n("Updating compatibility tool...")); Q_EMIT launcher.stageChanged(i18n("Updating compatibility tool..."));
@ -245,7 +245,7 @@ QCoro::Task<bool> AssetUpdater::installCompatibilityTool()
co_return true; co_return true;
} }
QCoro::Task<bool> AssetUpdater::installDxvkTool() QCoro::Task<bool> AssetUpdater::installDxvkTool() const
{ {
Q_EMIT launcher.stageChanged(i18n("Updating DXVK...")); Q_EMIT launcher.stageChanged(i18n("Updating DXVK..."));

View file

@ -67,7 +67,7 @@ QCoro::Task<std::optional<LoginAuth>> SquareEnixLogin::login(LoginInformation *i
co_return m_auth; co_return m_auth;
} }
QCoro::Task<bool> SquareEnixLogin::checkGateStatus() QCoro::Task<bool> SquareEnixLogin::checkGateStatus() const
{ {
Q_EMIT m_launcher.stageChanged(i18n("Checking gate...")); Q_EMIT m_launcher.stageChanged(i18n("Checking gate..."));
qInfo(ASTRA_LOG) << "Checking if the gate is open..."; qInfo(ASTRA_LOG) << "Checking if the gate is open...";
@ -108,7 +108,7 @@ QCoro::Task<bool> SquareEnixLogin::checkGateStatus()
co_return false; co_return false;
} }
QCoro::Task<bool> SquareEnixLogin::checkLoginStatus() QCoro::Task<bool> SquareEnixLogin::checkLoginStatus() const
{ {
Q_EMIT m_launcher.stageChanged(i18n("Checking login...")); Q_EMIT m_launcher.stageChanged(i18n("Checking login..."));
qInfo(ASTRA_LOG) << "Checking if login is open..."; qInfo(ASTRA_LOG) << "Checking if login is open...";
@ -416,7 +416,7 @@ QCoro::Task<bool> SquareEnixLogin::registerSession()
co_return false; co_return false;
} }
QCoro::Task<QString> SquareEnixLogin::getBootHash() QCoro::Task<QString> SquareEnixLogin::getBootHash() const
{ {
const QList<QString> fileList = {QStringLiteral("ffxivboot.exe"), const QList<QString> fileList = {QStringLiteral("ffxivboot.exe"),
QStringLiteral("ffxivboot64.exe"), QStringLiteral("ffxivboot64.exe"),

View file

@ -3,7 +3,6 @@
#include "steamapi.h" #include "steamapi.h"
#include "astra_log.h"
#include "launchercore.h" #include "launchercore.h"
SteamAPI::SteamAPI(QObject *parent) SteamAPI::SteamAPI(QObject *parent)