summaryrefslogtreecommitdiffstats
path: root/logic/net
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2013-10-26 02:28:50 +0100
committerSky <git@bunnies.cc>2013-10-26 02:31:58 +0100
commit0430a2a38fe3b6a18dc13090c236272fbb85df0b (patch)
treeec07fae4d522e83297f84e7b76e95b0b322663e6 /logic/net
parentba938dd8e2cf95110624a338a891e8395bc4a1d2 (diff)
downloadMultiMC-0430a2a38fe3b6a18dc13090c236272fbb85df0b.tar
MultiMC-0430a2a38fe3b6a18dc13090c236272fbb85df0b.tar.gz
MultiMC-0430a2a38fe3b6a18dc13090c236272fbb85df0b.tar.lz
MultiMC-0430a2a38fe3b6a18dc13090c236272fbb85df0b.tar.xz
MultiMC-0430a2a38fe3b6a18dc13090c236272fbb85df0b.zip
Add assets download status to status bar.
Diffstat (limited to 'logic/net')
-rw-r--r--logic/net/DownloadJob.cpp3
-rw-r--r--logic/net/DownloadJob.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/logic/net/DownloadJob.cpp b/logic/net/DownloadJob.cpp
index fa3e655e..38716a02 100644
--- a/logic/net/DownloadJob.cpp
+++ b/logic/net/DownloadJob.cpp
@@ -56,6 +56,8 @@ void DownloadJob::partSucceeded(int index)
num_succeeded++;
QLOG_INFO() << m_job_name.toLocal8Bit() << "progress:" << num_succeeded << "/"
<< downloads.size();
+ emit filesProgress(num_succeeded, num_failed, downloads.size());
+
if (num_failed + num_succeeded == downloads.size())
{
if (num_failed)
@@ -78,6 +80,7 @@ void DownloadJob::partFailed(int index)
{
QLOG_ERROR() << "Part" << index << "failed 3 times (" << downloads[index]->m_url << ")";
num_failed++;
+ emit filesProgress(num_succeeded, num_failed, downloads.size());
if (num_failed + num_succeeded == downloads.size())
{
QLOG_ERROR() << m_job_name.toLocal8Bit() << "failed.";
diff --git a/logic/net/DownloadJob.h b/logic/net/DownloadJob.h
index 91b014ad..cc2a1d59 100644
--- a/logic/net/DownloadJob.h
+++ b/logic/net/DownloadJob.h
@@ -1,5 +1,6 @@
#pragma once
#include <QtNetwork>
+#include <QLabel>
#include "Download.h"
#include "ByteArrayDownload.h"
#include "FileDownload.h"
@@ -57,12 +58,13 @@ public:
signals:
void started();
void progress(qint64 current, qint64 total);
+ void filesProgress(int, int, int);
void succeeded();
void failed();
public slots:
virtual void start();
private slots:
- void partProgress(int index, qint64 bytesReceived, qint64 bytesTotal);;
+ void partProgress(int index, qint64 bytesReceived, qint64 bytesTotal);
void partSucceeded(int index);
void partFailed(int index);
private: