diff options
author | Petr Mrázek <peterix@gmail.com> | 2021-12-31 05:27:59 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2021-12-31 05:27:59 +0100 |
commit | 9579231ccc36d9d32f4d5571ced91e8fe7851643 (patch) | |
tree | d91a8a010d6159d6a9b058b8383fc1da0d765bb7 /launcher/net | |
parent | 9cc168c5261c6cd0523287e995da58beee8f5096 (diff) | |
download | PrismLauncher-9579231ccc36d9d32f4d5571ced91e8fe7851643.tar.gz PrismLauncher-9579231ccc36d9d32f4d5571ced91e8fe7851643.tar.bz2 PrismLauncher-9579231ccc36d9d32f4d5571ced91e8fe7851643.zip |
NOISSUE fix build and change how NetJob is used
Feed it network upfront...
Diffstat (limited to 'launcher/net')
-rw-r--r-- | launcher/net/NetJob.cpp | 6 | ||||
-rw-r--r-- | launcher/net/NetJob.h | 11 |
2 files changed, 1 insertions, 16 deletions
diff --git a/launcher/net/NetJob.cpp b/launcher/net/NetJob.cpp index b190b3e9..9bad89ed 100644 --- a/launcher/net/NetJob.cpp +++ b/launcher/net/NetJob.cpp @@ -98,12 +98,6 @@ void NetJob::partProgress(int index, qint64 bytesReceived, qint64 bytesTotal) void NetJob::executeTask() { - if(!m_network) { - qCritical() << "Attempted to start NetJob" << objectName() << "without the network set!"; - emitFailed(tr("Internal error: NetJob '%1' has been started without a network pointer!").arg(objectName())); - return; - } - // hack that delays early failures so they can be caught easier QMetaObject::invokeMethod(this, "startMoreParts", Qt::QueuedConnection); } diff --git a/launcher/net/NetJob.h b/launcher/net/NetJob.h index 06b23306..fdea710f 100644 --- a/launcher/net/NetJob.h +++ b/launcher/net/NetJob.h @@ -29,17 +29,12 @@ class NetJob : public Task public: using Ptr = shared_qobject_ptr<NetJob>; - explicit NetJob(QString job_name) : Task() + explicit NetJob(QString job_name, shared_qobject_ptr<QNetworkAccessManager> network) : Task(), m_network(network) { setObjectName(job_name); } virtual ~NetJob(); - void setNetwork(shared_qobject_ptr<QNetworkAccessManager> network) - { - m_network = network; - } - bool addNetAction(NetAction::Ptr action); NetAction::Ptr operator[](int index) @@ -70,10 +65,6 @@ private slots: public slots: virtual void executeTask() override; virtual bool abort() override; - virtual void start(shared_qobject_ptr<QNetworkAccessManager> network) { - m_network = network; - Task::start(); - } private slots: void partProgress(int index, qint64 bytesReceived, qint64 bytesTotal); |