diff options
Diffstat (limited to 'api/logic/minecraft/MinecraftVersionList.cpp')
-rw-r--r-- | api/logic/minecraft/MinecraftVersionList.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/api/logic/minecraft/MinecraftVersionList.cpp b/api/logic/minecraft/MinecraftVersionList.cpp index a5cc3a39..4e4eafbc 100644 --- a/api/logic/minecraft/MinecraftVersionList.cpp +++ b/api/logic/minecraft/MinecraftVersionList.cpp @@ -68,6 +68,7 @@ slots: protected: NetJobPtr specificVersionDownloadJob; + QByteArray versionIndexData; std::shared_ptr<MinecraftVersion> updatedVersion; MinecraftVersionList *m_list; }; @@ -410,7 +411,7 @@ MCVListVersionUpdateTask::MCVListVersionUpdateTask(MinecraftVersionList *vlist, void MCVListVersionUpdateTask::executeTask() { auto job = new NetJob("Version index"); - job->addNetAction(ByteArrayDownload::make(QUrl(updatedVersion->getUrl()))); + job->addNetAction(Net::Download::makeByteArray(QUrl(updatedVersion->getUrl()), &versionIndexData)); specificVersionDownloadJob.reset(job); connect(specificVersionDownloadJob.get(), SIGNAL(succeeded()), SLOT(json_downloaded())); connect(specificVersionDownloadJob.get(), SIGNAL(failed(QString)), SIGNAL(failed(QString))); @@ -420,12 +421,11 @@ void MCVListVersionUpdateTask::executeTask() void MCVListVersionUpdateTask::json_downloaded() { - NetActionPtr DlJob = specificVersionDownloadJob->first(); - auto data = std::dynamic_pointer_cast<ByteArrayDownload>(DlJob)->m_data; specificVersionDownloadJob.reset(); QJsonParseError jsonError; - QJsonDocument jsonDoc = QJsonDocument::fromJson(data, &jsonError); + QJsonDocument jsonDoc = QJsonDocument::fromJson(versionIndexData, &jsonError); + versionIndexData.clear(); if (jsonError.error != QJsonParseError::NoError) { |