From 91776311c7faa5062bdfa0e543b513119d903002 Mon Sep 17 00:00:00 2001 From: flow Date: Mon, 6 Jun 2022 20:16:13 -0300 Subject: fix: allow aborting upload tasks This maintains the same behaviour as the Download task. Signed-off-by: flow --- launcher/net/Upload.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'launcher/net/Upload.cpp') diff --git a/launcher/net/Upload.cpp b/launcher/net/Upload.cpp index 12dd1e78..cfda4b4e 100644 --- a/launcher/net/Upload.cpp +++ b/launcher/net/Upload.cpp @@ -43,6 +43,16 @@ namespace Net { + bool Upload::abort() + { + if (m_reply) { + m_reply->abort(); + } else { + m_state = State::AbortedByUser; + } + return true; + } + void Upload::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) { setProgress(bytesReceived, bytesTotal); } -- cgit