diff --git a/launcher/include/patcher.h b/launcher/include/patcher.h index d44689d..ec9b506 100644 --- a/launcher/include/patcher.h +++ b/launcher/include/patcher.h @@ -42,7 +42,7 @@ private: long length; bool isBoot; - long bytesDownloaded; + long bytesDownloaded = 0; bool downloaded = false; [[nodiscard]] QString getVersion() const diff --git a/launcher/include/profilemanager.h b/launcher/include/profilemanager.h index ddf1f29..c2a86e2 100644 --- a/launcher/include/profilemanager.h +++ b/launcher/include/profilemanager.h @@ -41,7 +41,7 @@ public: Q_INVOKABLE bool canDelete(Profile *account) const; - Q_INVOKABLE bool hasAnyExistingInstallations() const; + [[nodiscard]] Q_INVOKABLE bool hasAnyExistingInstallations() const; static QString getDefaultGamePath(const QString &uuid); static QString getDefaultWinePrefixPath(const QString &uuid); diff --git a/launcher/src/accountmanager.cpp b/launcher/src/accountmanager.cpp index 28d593a..df3ce86 100644 --- a/launcher/src/accountmanager.cpp +++ b/launcher/src/accountmanager.cpp @@ -28,7 +28,7 @@ void AccountManager::load() int AccountManager::rowCount(const QModelIndex &index) const { - Q_UNUSED(index); + Q_UNUSED(index) return static_cast(m_accounts.size()); } diff --git a/launcher/src/patcher.cpp b/launcher/src/patcher.cpp index 253244e..f046b14 100644 --- a/launcher/src/patcher.cpp +++ b/launcher/src/patcher.cpp @@ -76,7 +76,14 @@ QCoro::Task Patcher::patch(const PatchList &patchList) const QString patchPath = repositoryDir.absoluteFilePath(filename); - const QueuedPatch queuedPatch{patch.name, patch.repository, patch.version, patchPath, patch.hashes, patch.hashBlockSize, patch.length, isBoot()}; + const QueuedPatch queuedPatch{.name = patch.name, + .repository = patch.repository, + .version = patch.version, + .path = patchPath, + .hashes = patch.hashes, + .hashBlockSize = patch.hashBlockSize, + .length = patch.length, + .isBoot = isBoot()}; qDebug(ASTRA_PATCHER) << "Adding a queued patch:"; qDebug(ASTRA_PATCHER) << "- Name:" << patch.name; @@ -96,6 +103,7 @@ QCoro::Task Patcher::patch(const PatchList &patchList) auto patchReply = m_launcher.mgr()->get(patchRequest); connect(patchReply, &QNetworkReply::downloadProgress, this, [this, ourIndex, queuedPatch](int received, int total) { + Q_UNUSED(total) updateDownloadProgress(ourIndex, received); }); diff --git a/launcher/src/patchlist.cpp b/launcher/src/patchlist.cpp index 3e8d853..9fd6974 100644 --- a/launcher/src/patchlist.cpp +++ b/launcher/src/patchlist.cpp @@ -4,8 +4,6 @@ #include "patchlist.h" #include "astra_patcher_log.h" -#include - PatchList::PatchList(const QString &patchList) { const QStringList parts = patchList.split(QStringLiteral("\r\n")); diff --git a/launcher/src/profilemanager.cpp b/launcher/src/profilemanager.cpp index 33936ae..8f93894 100644 --- a/launcher/src/profilemanager.cpp +++ b/launcher/src/profilemanager.cpp @@ -107,7 +107,7 @@ void ProfileManager::load() int ProfileManager::rowCount(const QModelIndex &index) const { - Q_UNUSED(index); + Q_UNUSED(index) return static_cast(m_profiles.size()); }