diff options
author | flow <thiagodonato300@gmail.com> | 2022-05-01 11:05:31 -0300 |
---|---|---|
committer | flow <thiagodonato300@gmail.com> | 2022-05-12 18:11:55 -0300 |
commit | 57d65177c8ebb5463c88dd8e26f1e0a33f648bed (patch) | |
tree | 9dce3e052a5aca871e353946355b113ae8ca2ef6 /launcher/net/Download.cpp | |
parent | 040ee919e5ea71364daa08c30e09c843976f5734 (diff) | |
download | PrismLauncher-57d65177c8ebb5463c88dd8e26f1e0a33f648bed.tar.gz PrismLauncher-57d65177c8ebb5463c88dd8e26f1e0a33f648bed.tar.bz2 PrismLauncher-57d65177c8ebb5463c88dd8e26f1e0a33f648bed.zip |
fix: abort and fail logic in tasks
Also sets up correctly the status connections
Diffstat (limited to 'launcher/net/Download.cpp')
-rw-r--r-- | launcher/net/Download.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/launcher/net/Download.cpp b/launcher/net/Download.cpp index 3d6ca338..9c01fa8d 100644 --- a/launcher/net/Download.cpp +++ b/launcher/net/Download.cpp @@ -69,6 +69,8 @@ void Download::addValidator(Validator* v) void Download::executeTask() { + setStatus(tr("Downloading %1").arg(m_url.toString())); + if (getState() == Task::State::AbortedByUser) { qWarning() << "Attempt to start an aborted Download:" << m_url.toString(); emitAborted(); @@ -90,6 +92,7 @@ void Download::executeTask() emitFailed(); return; case State::AbortedByUser: + emitAborted(); return; } @@ -216,13 +219,13 @@ void Download::downloadFinished() qDebug() << "Download failed in previous step:" << m_url.toString(); m_sink->abort(); m_reply.reset(); - emitFailed(); + emit failed(""); return; } else if (m_state == State::AbortedByUser) { qDebug() << "Download aborted in previous step:" << m_url.toString(); m_sink->abort(); m_reply.reset(); - emitAborted(); + emit aborted(); return; } @@ -239,7 +242,7 @@ void Download::downloadFinished() qDebug() << "Download failed to finalize:" << m_url.toString(); m_sink->abort(); m_reply.reset(); - emitFailed(); + emit failed(""); return; } |