summaryrefslogtreecommitdiffstats
path: root/api/logic/net
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-07-07 19:46:56 +0200
committerPetr Mrázek <peterix@gmail.com>2017-07-07 19:46:56 +0200
commite5b4b5d2954d72f0323ced8e7d14f5ce9606e4cb (patch)
tree5baef66192a4d73fbee3ff9652e55b121882ec76 /api/logic/net
parentfbeceaa98cc252c671ef6a9d26837973cc9bffa3 (diff)
downloadMultiMC-e5b4b5d2954d72f0323ced8e7d14f5ce9606e4cb.tar
MultiMC-e5b4b5d2954d72f0323ced8e7d14f5ce9606e4cb.tar.gz
MultiMC-e5b4b5d2954d72f0323ced8e7d14f5ce9606e4cb.tar.lz
MultiMC-e5b4b5d2954d72f0323ced8e7d14f5ce9606e4cb.tar.xz
MultiMC-e5b4b5d2954d72f0323ced8e7d14f5ce9606e4cb.zip
GH-1927 Add more specific task status logging
* Tasks are now described by class name and object name (or memory address). * Tasks starts are logged. * Aborted tasks are now treated just as the other cases.
Diffstat (limited to 'api/logic/net')
-rw-r--r--api/logic/net/NetJob.cpp8
-rw-r--r--api/logic/net/NetJob.h6
2 files changed, 6 insertions, 8 deletions
diff --git a/api/logic/net/NetJob.cpp b/api/logic/net/NetJob.cpp
index 65d649f5..9a8277b0 100644
--- a/api/logic/net/NetJob.cpp
+++ b/api/logic/net/NetJob.cpp
@@ -94,7 +94,6 @@ void NetJob::partProgress(int index, qint64 bytesReceived, qint64 bytesTotal)
void NetJob::executeTask()
{
- qDebug() << m_job_name.toLocal8Bit() << " started.";
// hack that delays early failures so they can be caught easier
QMetaObject::invokeMethod(this, "startMoreParts", Qt::QueuedConnection);
}
@@ -114,18 +113,15 @@ void NetJob::startMoreParts()
{
if(!m_failed.size())
{
- qDebug() << m_job_name << "succeeded.";
emitSucceeded();
}
else if(m_aborted)
{
- qDebug() << m_job_name << "aborted.";
- emitFailed(tr("Job '%1' aborted.").arg(m_job_name));
+ emitAborted();
}
else
{
- qCritical() << m_job_name << "failed.";
- emitFailed(tr("Job '%1' failed to process:\n%2").arg(m_job_name).arg(getFailedFiles().join("\n")));
+ emitFailed(tr("Job '%1' failed to process:\n%2").arg(objectName()).arg(getFailedFiles().join("\n")));
}
}
return;
diff --git a/api/logic/net/NetJob.h b/api/logic/net/NetJob.h
index 2b5c3d9a..6ae3a73f 100644
--- a/api/logic/net/NetJob.h
+++ b/api/logic/net/NetJob.h
@@ -30,7 +30,10 @@ class MULTIMC_LOGIC_EXPORT NetJob : public Task
{
Q_OBJECT
public:
- explicit NetJob(QString job_name) : Task(), m_job_name(job_name) {}
+ explicit NetJob(QString job_name) : Task()
+ {
+ setObjectName(job_name);
+ }
virtual ~NetJob() {}
bool addNetAction(NetActionPtr action);
@@ -77,7 +80,6 @@ private:
qint64 total_progress = 1;
int failures = 0;
};
- QString m_job_name;
QList<NetActionPtr> downloads;
QList<part_info> parts_progress;
QQueue<int> m_todo;