mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-22 20:47:45 +00:00
Use more static_cast explicit casts
This commit is contained in:
parent
52ac3d0593
commit
68d8d9f042
5 changed files with 10 additions and 16 deletions
|
@ -121,7 +121,7 @@ bool AccountManager::hasAnyAccounts() const
|
|||
|
||||
int AccountManager::numAccounts() const
|
||||
{
|
||||
return m_accounts.count();
|
||||
return static_cast<int>(m_accounts.count());
|
||||
}
|
||||
|
||||
#include "moc_accountmanager.cpp"
|
|
@ -1,6 +1,4 @@
|
|||
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#include "headline.h"
|
||||
|
||||
#include "moc_headline.cpp"
|
|
@ -60,7 +60,7 @@ QCoro::Task<bool> 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<int>(patchList.patches().size());
|
||||
m_patchQueue.resize(m_remainingPatches);
|
||||
|
||||
QFutureSynchronizer<void> synchronizer;
|
||||
|
@ -133,7 +133,7 @@ QCoro::Task<bool> 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<bool> 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<int>(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<int>(patch.length), static_cast<int>(patch.bytesDownloaded));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<int>(m_repositories.repositories_count) - 1;
|
||||
}
|
||||
|
||||
QString Profile::expansionVersion(const int index) const
|
||||
|
|
|
@ -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<int>(m_profiles.count());
|
||||
}
|
||||
|
||||
#include "moc_profilemanager.cpp"
|
Loading…
Add table
Reference in a new issue