fix: add missing returns after emitFailed/Aborted

Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Octol1ttle 2026-01-21 18:20:34 +05:00
parent ef747055af
commit 507de0fcbd
No known key found for this signature in database
GPG key ID: B77C34313AEE1FFF
12 changed files with 17 additions and 11 deletions

View file

@ -103,8 +103,8 @@ void ResourceDownloadTask::downloadSucceeded()
void ResourceDownloadTask::downloadFailed(QString reason)
{
emitFailed(reason);
m_filesNetJob.reset();
emitFailed(reason);
}
void ResourceDownloadTask::downloadProgressChanged(qint64 current, qint64 total)

View file

@ -773,8 +773,9 @@ void ComponentUpdateTask::checkIfAllFinished()
.arg(component->getName(), component->m_version));
}
}
d->remoteLoadStatusList.clear();
auto allErrors = allErrorsList.join("\n");
emitFailed(tr("Component metadata update task failed while downloading from remote server:\n%1").arg(allErrors));
d->remoteLoadStatusList.clear();
}
}

View file

@ -151,8 +151,8 @@ bool AuthFlow::changeState(AccountTaskState newState, QString reason)
}
bool AuthFlow::abort()
{
emitAborted();
if (m_currentStep)
m_currentStep->abort();
emitAborted();
return true;
}

View file

@ -175,8 +175,8 @@ void AutoInstallJava::downloadJava(Meta::Version::Ptr version, QString javaName)
m_current_task = makeShared<Java::ArchiveDownloadTask>(java->url, final_path, java->checksumType, java->checksumHash);
break;
case Java::DownloadType::Unknown:
emitFailed(tr("Could not determine Java download type!"));
deletePath();
emitFailed(tr("Could not determine Java download type!"));
return;
}
#if defined(Q_OS_MACOS)

View file

@ -75,6 +75,7 @@ void ExtractNatives::executeTask()
const char* reason = QT_TR_NOOP("Couldn't extract native jar '%1' to destination '%2'");
emit logLine(QString(reason).arg(source, outputPath), MessageLevel::Fatal);
emitFailed(tr(reason).arg(source, outputPath));
return;
}
}
emitSucceeded();

View file

@ -51,11 +51,13 @@ void ModMinecraftJar::executeTask()
// nuke obsolete stripped jar(s) if needed
if (!FS::ensureFolderPathExists(m_inst->binRoot())) {
emitFailed(tr("Couldn't create the bin folder for Minecraft.jar"));
return;
}
auto finalJarPath = QDir(m_inst->binRoot()).absoluteFilePath("minecraft.jar");
if (!removeJar()) {
emitFailed(tr("Couldn't remove stale jar file: %1").arg(finalJarPath));
return;
}
// create temporary modded jar, if needed

View file

@ -32,6 +32,7 @@ LocalResourceUpdateTask::LocalResourceUpdateTask(QDir index_dir, ModPlatform::In
// Ensure a '.index' folder exists in the mods folder, and create it if it does not
if (!FS::ensureFolderPathExists(index_dir.path())) {
emitFailed(QString("Unable to create index directory at %1!").arg(index_dir.absolutePath()));
return;
}
#ifdef Q_OS_WIN32

View file

@ -68,6 +68,7 @@ void AssetUpdateTask::assetIndexFinished()
auto entry = metacache->resolveEntry("asset_indexes", assets->id + ".json");
metacache->evictEntry(entry);
emitFailed(tr("Failed to read the assets index!"));
return;
}
auto job = index.getDownloadJob();

View file

@ -97,10 +97,10 @@ void PackFetchTask::fetchPrivate(const QStringList& toFetch)
});
connect(job, &NetJob::aborted, this, [this, job, data] {
emit aborted();
job->deleteLater();
data->clear();
emit aborted();
});
job->start();

View file

@ -78,8 +78,8 @@ void Technic::SingleZipPackInstallTask::downloadSucceeded()
void Technic::SingleZipPackInstallTask::downloadFailed(QString reason)
{
m_abortable = false;
emitFailed(reason);
m_filesNetJob.reset();
emitFailed(reason);
}
void Technic::SingleZipPackInstallTask::downloadProgressChanged(qint64 current, qint64 total)

View file

@ -98,8 +98,8 @@ void Technic::SolderPackInstallTask::fileListSucceeded()
try {
TechnicSolder::loadPackBuild(build, obj);
} catch (const JSONValidationError& e) {
emitFailed(tr("Could not understand pack manifest:\n") + e.cause());
m_filesNetJob.reset();
emitFailed(tr("Could not understand pack manifest:\n") + e.cause());
return;
}
@ -159,8 +159,8 @@ void Technic::SolderPackInstallTask::downloadSucceeded()
void Technic::SolderPackInstallTask::downloadFailed(QString reason)
{
m_abortable = false;
emitFailed(reason);
m_filesNetJob.reset();
emitFailed(reason);
}
void Technic::SolderPackInstallTask::downloadProgressChanged(qint64 current, qint64 total)
@ -171,8 +171,8 @@ void Technic::SolderPackInstallTask::downloadProgressChanged(qint64 current, qin
void Technic::SolderPackInstallTask::downloadAborted()
{
emitAborted();
m_filesNetJob.reset();
emitAborted();
}
void Technic::SolderPackInstallTask::extractFinished()

View file

@ -42,9 +42,9 @@ SequentialTask::SequentialTask(QString task_name) : ConcurrentTask(task_name, 1)
void SequentialTask::subTaskFailed(Task::Ptr task, const QString& msg)
{
emitFailed(msg);
qWarning() << msg;
ConcurrentTask::subTaskFailed(task, msg);
emitFailed(msg);
}
void SequentialTask::updateState()