diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-04-29 21:34:36 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-04-29 21:34:36 +0200 |
commit | 1be99b075ab1911e65a165e3b47513a3a8e290f3 (patch) | |
tree | fcd390641e04f3833a1afc3b351471bc2af7bd9c /api | |
parent | e1465f4848d003cab3d3d1288c1a0f3b945083ee (diff) | |
download | MultiMC-1be99b075ab1911e65a165e3b47513a3a8e290f3.tar MultiMC-1be99b075ab1911e65a165e3b47513a3a8e290f3.tar.gz MultiMC-1be99b075ab1911e65a165e3b47513a3a8e290f3.tar.lz MultiMC-1be99b075ab1911e65a165e3b47513a3a8e290f3.tar.xz MultiMC-1be99b075ab1911e65a165e3b47513a3a8e290f3.zip |
NOISSUE more NetAction and NetJob cleanups
Diffstat (limited to 'api')
-rw-r--r-- | api/logic/net/NetAction.h | 1 | ||||
-rw-r--r-- | api/logic/net/NetJob.cpp | 1 | ||||
-rw-r--r-- | api/logic/net/NetJob.h | 21 | ||||
-rw-r--r-- | api/logic/tasks/Task.h | 1 |
4 files changed, 3 insertions, 21 deletions
diff --git a/api/logic/net/NetAction.h b/api/logic/net/NetAction.h index 13966a5c..bbd4a4be 100644 --- a/api/logic/net/NetAction.h +++ b/api/logic/net/NetAction.h @@ -38,6 +38,7 @@ public: public: unique_qobject_ptr<QNetworkReply> m_reply; QUrl m_url; + // FIXME: pull this up into Task Status m_status = Status::NotStarted; signals: diff --git a/api/logic/net/NetJob.cpp b/api/logic/net/NetJob.cpp index f4fd7245..cf04998f 100644 --- a/api/logic/net/NetJob.cpp +++ b/api/logic/net/NetJob.cpp @@ -83,7 +83,6 @@ void NetJob::setPartProgress(int index, qint64 bytesReceived, qint64 bytesTotal) void NetJob::executeTask() { qDebug() << m_job_name.toLocal8Bit() << " started."; - m_running = true; for (int i = 0; i < m_parts.size(); i++) { m_todo.enqueue(i); diff --git a/api/logic/net/NetJob.h b/api/logic/net/NetJob.h index d49c8bf7..637c4af5 100644 --- a/api/logic/net/NetJob.h +++ b/api/logic/net/NetJob.h @@ -35,28 +35,10 @@ public: void addNetAction(NetActionPtr action); - NetActionPtr operator[](int index) - { - return m_parts[index].download; - } - const NetActionPtr at(const int index) - { - return m_parts[index].download; - } - NetActionPtr first() - { - if (m_parts.size()) - return m_parts[0].download; - return NetActionPtr(); - } int size() const { return m_parts.size(); } - virtual bool isRunning() const override - { - return m_running; - } QStringList getFailedFiles(); bool canAbort() const override; @@ -88,7 +70,7 @@ private: bool connected = false; }; QString m_job_name; - QList<part_info> m_parts; + QVector<part_info> m_parts; QMap<NetAction *, int> m_partsIndex; QQueue<int> m_todo; QSet<int> m_doing; @@ -96,6 +78,5 @@ private: QSet<int> m_failed; qint64 current_progress = 0; qint64 total_progress = 0; - bool m_running = false; bool m_aborted = false; }; diff --git a/api/logic/tasks/Task.h b/api/logic/tasks/Task.h index 9bc2781f..17ea87f3 100644 --- a/api/logic/tasks/Task.h +++ b/api/logic/tasks/Task.h @@ -100,6 +100,7 @@ public slots: void setProgress(qint64 current, qint64 total); protected: + // FIXME: replace these with the m_status from NetAction bool m_running = false; bool m_finished = false; bool m_succeeded = false; |