diff --git a/launcher/src/accountmanager.cpp b/launcher/src/accountmanager.cpp index 0de7660..408d2e6 100644 --- a/launcher/src/accountmanager.cpp +++ b/launcher/src/accountmanager.cpp @@ -121,7 +121,7 @@ bool AccountManager::hasAnyAccounts() const int AccountManager::numAccounts() const { - return m_accounts.count(); + return static_cast(m_accounts.count()); } #include "moc_accountmanager.cpp" \ No newline at end of file diff --git a/launcher/src/headline.cpp b/launcher/src/headline.cpp index a221782..bc30ba4 100644 --- a/launcher/src/headline.cpp +++ b/launcher/src/headline.cpp @@ -1,6 +1,4 @@ // SPDX-FileCopyrightText: 2023 Joshua Goins // SPDX-License-Identifier: GPL-3.0-or-later -#include "headline.h" - #include "moc_headline.cpp" \ No newline at end of file diff --git a/launcher/src/patcher.cpp b/launcher/src/patcher.cpp index d456c71..b4567bb 100644 --- a/launcher/src/patcher.cpp +++ b/launcher/src/patcher.cpp @@ -60,7 +60,7 @@ QCoro::Task Patcher::patch(const PatchList &patchList) Q_EMIT m_launcher.stageIndeterminate(); Q_EMIT m_launcher.stageChanged(i18n("Updating %1", getBaseString())); - m_remainingPatches = patchList.patches().size(); + m_remainingPatches = static_cast(patchList.patches().size()); m_patchQueue.resize(m_remainingPatches); QFutureSynchronizer synchronizer; @@ -133,7 +133,7 @@ QCoro::Task Patcher::patch(const PatchList &patchList) }); // This must happen synchronously - size_t i = 0; + int i = 0; for (const auto &patch : m_patchQueue) { QString repositoryName = patch.repository; if (repositoryName == QStringLiteral("game")) { @@ -141,7 +141,7 @@ QCoro::Task Patcher::patch(const PatchList &patchList) } Q_EMIT m_launcher.stageChanged(i18n("Installing %1 - %2 [%3/%4]", repositoryName, patch.version, i++, m_remainingPatches)); - Q_EMIT m_launcher.stageDeterminate(0, m_patchQueue.size(), i++); + Q_EMIT m_launcher.stageDeterminate(0, static_cast(m_patchQueue.size()), i++); co_await QtConcurrent::run([this, patch] { processPatch(patch); @@ -249,7 +249,7 @@ void Patcher::updateMessage() Q_EMIT m_launcher.stageChanged(i18n("Downloading %1 - %2 [%3/%4]", repositoryName, patch.version, m_finishedPatches, m_remainingPatches), i18n("%1%", progressStr)); - Q_EMIT m_launcher.stageDeterminate(0, patch.length, patch.bytesDownloaded); + Q_EMIT m_launcher.stageDeterminate(0, static_cast(patch.length), static_cast(patch.bytesDownloaded)); return; } } diff --git a/launcher/src/profile.cpp b/launcher/src/profile.cpp index 856918e..9a32a30 100644 --- a/launcher/src/profile.cpp +++ b/launcher/src/profile.cpp @@ -524,7 +524,7 @@ QString Profile::baseGameVersion() const int Profile::numInstalledExpansions() const { Q_ASSERT(m_repositories.repositories_count >= 1); - return m_repositories.repositories_count - 1; + return static_cast(m_repositories.repositories_count) - 1; } QString Profile::expansionVersion(const int index) const diff --git a/launcher/src/profilemanager.cpp b/launcher/src/profilemanager.cpp index 65d73e3..394c477 100644 --- a/launcher/src/profilemanager.cpp +++ b/launcher/src/profilemanager.cpp @@ -152,18 +152,14 @@ bool ProfileManager::canDelete(Profile *account) const bool ProfileManager::hasAnyExistingInstallations() const { - for (auto &profile : m_profiles) { - if (profile->isGameInstalled()) { - return true; - } - } - - return false; + return std::ranges::any_of(m_profiles, [](const auto &profile) { + return profile->isGameInstalled(); + }); } int ProfileManager::numProfiles() const { - return m_profiles.count(); + return static_cast(m_profiles.count()); } #include "moc_profilemanager.cpp" \ No newline at end of file