diff options
author | Petr Mrázek <peterix@gmail.com> | 2021-11-21 23:21:12 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2021-11-21 23:21:12 +0100 |
commit | 69213b1206e97f7d4db4270a4b3b0af41dc9e6fc (patch) | |
tree | b53ca69422ce22cceee9e648171a678679075c1a /launcher/modplatform/flame | |
parent | c2c56a2f6ceaedb8a3fa88c848b345db0fec7f9c (diff) | |
download | PrismLauncher-69213b1206e97f7d4db4270a4b3b0af41dc9e6fc.tar.gz PrismLauncher-69213b1206e97f7d4db4270a4b3b0af41dc9e6fc.tar.bz2 PrismLauncher-69213b1206e97f7d4db4270a4b3b0af41dc9e6fc.zip |
NOISSUE continue refactoring things to make tests pass
Diffstat (limited to 'launcher/modplatform/flame')
-rw-r--r-- | launcher/modplatform/flame/FileResolvingTask.cpp | 8 | ||||
-rw-r--r-- | launcher/modplatform/flame/FileResolvingTask.h | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/launcher/modplatform/flame/FileResolvingTask.cpp b/launcher/modplatform/flame/FileResolvingTask.cpp index 295574f0..06f0cf2b 100644 --- a/launcher/modplatform/flame/FileResolvingTask.cpp +++ b/launcher/modplatform/flame/FileResolvingTask.cpp @@ -5,8 +5,8 @@ namespace { const char * metabase = "https://cursemeta.dries007.net"; } -Flame::FileResolvingTask::FileResolvingTask(Flame::Manifest& toProcess) - : m_toProcess(toProcess) +Flame::FileResolvingTask::FileResolvingTask(shared_qobject_ptr<QNetworkAccessManager> network, Flame::Manifest& toProcess) + : m_network(network), m_toProcess(toProcess) { } @@ -14,7 +14,7 @@ void Flame::FileResolvingTask::executeTask() { setStatus(tr("Resolving mod IDs...")); setProgress(0, m_toProcess.files.size()); - m_dljob.reset(new NetJob("Mod id resolver")); + m_dljob = new NetJob("Mod id resolver"); results.resize(m_toProcess.files.size()); int index = 0; for(auto & file: m_toProcess.files) @@ -27,7 +27,7 @@ void Flame::FileResolvingTask::executeTask() index ++; } connect(m_dljob.get(), &NetJob::finished, this, &Flame::FileResolvingTask::netJobFinished); - m_dljob->start(); + m_dljob->start(m_network); } void Flame::FileResolvingTask::netJobFinished() diff --git a/launcher/modplatform/flame/FileResolvingTask.h b/launcher/modplatform/flame/FileResolvingTask.h index 78a38fcb..5e5adcd7 100644 --- a/launcher/modplatform/flame/FileResolvingTask.h +++ b/launcher/modplatform/flame/FileResolvingTask.h @@ -10,7 +10,7 @@ class FileResolvingTask : public Task { Q_OBJECT public: - explicit FileResolvingTask(Flame::Manifest &toProcess); + explicit FileResolvingTask(shared_qobject_ptr<QNetworkAccessManager> network, Flame::Manifest &toProcess); virtual ~FileResolvingTask() {}; const Flame::Manifest &getResults() const @@ -25,8 +25,9 @@ protected slots: void netJobFinished(); private: /* data */ + shared_qobject_ptr<QNetworkAccessManager> m_network; Flame::Manifest m_toProcess; QVector<QByteArray> results; - NetJobPtr m_dljob; + NetJob::Ptr m_dljob; }; } |