chore(clang-tidy): fix clang tidy warnings

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2026-05-07 13:43:57 +03:00
parent ca721f9d67
commit a63048d7e2
19 changed files with 494 additions and 405 deletions

View file

@ -60,11 +60,11 @@ Net::ModrinthDownloadMeta createModrinthMeta(BaseInstance* instance, QString rea
ResourceDownloadTask::ResourceDownloadTask(ModPlatform::IndexedPack::Ptr pack,
ModPlatform::IndexedVersion version,
ResourceFolderModel* packs,
bool is_indexed,
bool isIndexed,
QString downloadReason)
: m_pack(std::move(pack)), m_pack_version(std::move(version)), m_pack_model(packs)
{
if (is_indexed) {
if (isIndexed) {
m_update_task.reset(new LocalResourceUpdateTask(m_pack_model->indexDir(), *m_pack, m_pack_version));
connect(m_update_task.get(), &LocalResourceUpdateTask::hasOldResource, this, &ResourceDownloadTask::hasOldResource);
@ -113,8 +113,9 @@ void ResourceDownloadTask::downloadSucceeded()
auto oldName = std::get<0>(to_delete);
auto oldFilename = std::get<1>(to_delete);
if (oldName.isEmpty() || oldFilename == m_pack_version.fileName)
if (oldName.isEmpty() || oldFilename == m_pack_version.fileName) {
return;
}
m_pack_model->uninstallResource(oldFilename, true);
@ -126,8 +127,9 @@ void ResourceDownloadTask::downloadSucceeded()
if (oldConfig.exists() && !newConfig.exists()) {
bool success = FS::move(oldConfig.filePath(), newConfig.filePath());
if (!success)
if (!success) {
emit logWarning(tr("Failed to rename shader config from '%1' to '%2'").arg(oldConfig.fileName(), newConfig.fileName()));
}
}
}
}
@ -135,7 +137,7 @@ void ResourceDownloadTask::downloadSucceeded()
void ResourceDownloadTask::downloadFailed(QString reason)
{
m_filesNetJob.reset();
emitFailed(reason);
emitFailed(std::move(reason));
}
void ResourceDownloadTask::downloadProgressChanged(qint64 current, qint64 total)
@ -145,7 +147,7 @@ void ResourceDownloadTask::downloadProgressChanged(qint64 current, qint64 total)
// This indirection is done so that we don't delete a mod before being sure it was
// downloaded successfully!
void ResourceDownloadTask::hasOldResource(QString name, QString filename)
void ResourceDownloadTask::hasOldResource(const QString& name, const QString& filename)
{
to_delete = { name, filename };
}