From eae544f0ebc26a2b103091b93d4f7c4188d00cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Fri, 27 Mar 2015 02:03:14 +0100 Subject: [PATCH] GH-841 fix for modpack downloads on windows --- gui/MainWindow.cpp | 3 ++- logic/net/NetJob.cpp | 3 ++- logic/net/NetJob.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index 0231dd44..b28d2d9b 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -1075,12 +1075,13 @@ void MainWindow::on_actionAddInstance_triggered() } else { - const QString path = modpackUrl.host() + '/' + QString::fromUtf8(modpackUrl.toEncoded()); + const QString path = modpackUrl.host() + '/' + modpackUrl.path(); auto entry = MMC->metacache()->resolveEntry("general", path); CacheDownloadPtr dl = CacheDownload::make(modpackUrl, entry); NetJob job(tr("Modpack download")); job.addNetAction(dl); + // FIXME: possibly causes endless loop problems ProgressDialog dlDialog(this); if (dlDialog.exec(&job) != QDialog::Accepted) { diff --git a/logic/net/NetJob.cpp b/logic/net/NetJob.cpp index 6d10db48..85892581 100644 --- a/logic/net/NetJob.cpp +++ b/logic/net/NetJob.cpp @@ -73,7 +73,8 @@ void NetJob::start() { m_todo.enqueue(i); } - startMoreParts(); + // hack that delays early failures so they can be caught easier + QMetaObject::invokeMethod(this, "startMoreParts", Qt::QueuedConnection); } void NetJob::startMoreParts() diff --git a/logic/net/NetJob.h b/logic/net/NetJob.h index 30ae609a..0d8b7fbd 100644 --- a/logic/net/NetJob.h +++ b/logic/net/NetJob.h @@ -83,7 +83,7 @@ public: } QStringList getFailedFiles(); -private: +private slots: void startMoreParts(); signals: