summaryrefslogtreecommitdiffstats
path: root/logic/net
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-04-26 13:47:14 +0200
committerPetr Mrázek <peterix@gmail.com>2015-04-26 18:33:29 +0200
commit84549ed8078bdbd029aa5a89facc0412b8b5e753 (patch)
tree3a5bd2727195f18c42cdb428421cab5fc6562d9d /logic/net
parentd5c79db12c326bd0175cd2990764948a536abbbb (diff)
downloadMultiMC-84549ed8078bdbd029aa5a89facc0412b8b5e753.tar
MultiMC-84549ed8078bdbd029aa5a89facc0412b8b5e753.tar.gz
MultiMC-84549ed8078bdbd029aa5a89facc0412b8b5e753.tar.lz
MultiMC-84549ed8078bdbd029aa5a89facc0412b8b5e753.tar.xz
MultiMC-84549ed8078bdbd029aa5a89facc0412b8b5e753.zip
GH-849 Further NetJob related fixes
Diffstat (limited to 'logic/net')
-rw-r--r--logic/net/NetJob.cpp6
-rw-r--r--logic/net/NetJob.h8
2 files changed, 7 insertions, 7 deletions
diff --git a/logic/net/NetJob.cpp b/logic/net/NetJob.cpp
index b5503daf..40d2d1c9 100644
--- a/logic/net/NetJob.cpp
+++ b/logic/net/NetJob.cpp
@@ -64,7 +64,7 @@ void NetJob::partProgress(int index, qint64 bytesReceived, qint64 bytesTotal)
emit progress(current_progress, total_progress);
}
-void NetJob::start()
+void NetJob::executeTask()
{
qDebug() << m_job_name.toLocal8Bit() << " started.";
m_running = true;
@@ -86,12 +86,12 @@ void NetJob::startMoreParts()
if(!m_failed.size())
{
qDebug() << m_job_name << "succeeded.";
- emit succeeded();
+ emitSucceeded();
}
else
{
qCritical() << m_job_name << "failed.";
- emit failed(tr("%1 failed").arg(m_job_name));
+ emitFailed(tr("Job '%1' failed to process:\n%2").arg(m_job_name).arg(getFailedFiles().join("\n")));
}
}
return;
diff --git a/logic/net/NetJob.h b/logic/net/NetJob.h
index 912a74b3..c0172bea 100644
--- a/logic/net/NetJob.h
+++ b/logic/net/NetJob.h
@@ -21,17 +21,17 @@
#include "MD5EtagDownload.h"
#include "CacheDownload.h"
#include "HttpMetaCache.h"
-#include "tasks/ProgressProvider.h"
+#include "tasks/Task.h"
#include "QObjectPtr.h"
class NetJob;
typedef QObjectPtr<NetJob> NetJobPtr;
-class NetJob : public ProgressProvider
+class NetJob : public Task
{
Q_OBJECT
public:
- explicit NetJob(QString job_name) : ProgressProvider(), m_job_name(job_name) {}
+ explicit NetJob(QString job_name) : Task(), m_job_name(job_name) {}
virtual ~NetJob() {}
template <typename T> bool addNetAction(T action)
{
@@ -87,7 +87,7 @@ private slots:
void startMoreParts();
public slots:
- virtual void start();
+ virtual void executeTask();
// FIXME: implement
virtual void abort() {};