summaryrefslogtreecommitdiffstats
path: root/logic/minecraft
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-04-26 23:04:50 +0200
committerPetr Mrázek <peterix@gmail.com>2015-04-26 23:04:50 +0200
commitf8650e3965582a57c3d0ccb5f234e6229051b16a (patch)
treef815fc22ae303e0ebe491a5d38b3f09c94da948d /logic/minecraft
parent84549ed8078bdbd029aa5a89facc0412b8b5e753 (diff)
downloadMultiMC-f8650e3965582a57c3d0ccb5f234e6229051b16a.tar
MultiMC-f8650e3965582a57c3d0ccb5f234e6229051b16a.tar.gz
MultiMC-f8650e3965582a57c3d0ccb5f234e6229051b16a.tar.lz
MultiMC-f8650e3965582a57c3d0ccb5f234e6229051b16a.tar.xz
MultiMC-f8650e3965582a57c3d0ccb5f234e6229051b16a.zip
NOISSUE eliminate ProgressProvider
Diffstat (limited to 'logic/minecraft')
-rw-r--r--logic/minecraft/OneSixUpdate.cpp26
-rw-r--r--logic/minecraft/OneSixUpdate.h8
2 files changed, 17 insertions, 17 deletions
diff --git a/logic/minecraft/OneSixUpdate.cpp b/logic/minecraft/OneSixUpdate.cpp
index 8a7a1f66..8db0c68f 100644
--- a/logic/minecraft/OneSixUpdate.cpp
+++ b/logic/minecraft/OneSixUpdate.cpp
@@ -72,7 +72,7 @@ void OneSixUpdate::executeTask()
return;
}
connect(versionUpdateTask.get(), SIGNAL(succeeded()), SLOT(jarlibStart()));
- connect(versionUpdateTask.get(), SIGNAL(failed(QString)), SLOT(versionUpdateFailed(QString)));
+ connect(versionUpdateTask.get(), &NetJob::failed, this, &OneSixUpdate::versionUpdateFailed);
connect(versionUpdateTask.get(), SIGNAL(progress(qint64, qint64)),
SIGNAL(progress(qint64, qint64)));
setStatus(tr("Getting the version files from Mojang..."));
@@ -100,7 +100,7 @@ void OneSixUpdate::assetIndexStart()
jarlibDownloadJob.reset(job);
connect(jarlibDownloadJob.get(), SIGNAL(succeeded()), SLOT(assetIndexFinished()));
- connect(jarlibDownloadJob.get(), SIGNAL(failed()), SLOT(assetIndexFailed()));
+ connect(jarlibDownloadJob.get(), &NetJob::failed, this, &OneSixUpdate::assetIndexFailed);
connect(jarlibDownloadJob.get(), SIGNAL(progress(qint64, qint64)),
SIGNAL(progress(qint64, qint64)));
@@ -146,7 +146,7 @@ void OneSixUpdate::assetIndexFinished()
job->addNetAction(dl);
jarlibDownloadJob.reset(job);
connect(jarlibDownloadJob.get(), SIGNAL(succeeded()), SLOT(assetsFinished()));
- connect(jarlibDownloadJob.get(), SIGNAL(failed()), SLOT(assetsFailed()));
+ connect(jarlibDownloadJob.get(), &NetJob::failed, this, &OneSixUpdate::assetsFailed);
connect(jarlibDownloadJob.get(), SIGNAL(progress(qint64, qint64)),
SIGNAL(progress(qint64, qint64)));
jarlibDownloadJob->start();
@@ -155,9 +155,9 @@ void OneSixUpdate::assetIndexFinished()
assetsFinished();
}
-void OneSixUpdate::assetIndexFailed()
+void OneSixUpdate::assetIndexFailed(QString reason)
{
- emitFailed(tr("Failed to download the assets index!"));
+ emitFailed(tr("Failed to download the assets index:\n%1").arg(reason));
}
void OneSixUpdate::assetsFinished()
@@ -165,9 +165,9 @@ void OneSixUpdate::assetsFinished()
emitSucceeded();
}
-void OneSixUpdate::assetsFailed()
+void OneSixUpdate::assetsFailed(QString reason)
{
- emitFailed(tr("Failed to download assets!"));
+ emitFailed(tr("Failed to download assets:\n%1").arg(reason));
}
void OneSixUpdate::jarlibStart()
@@ -280,7 +280,7 @@ void OneSixUpdate::jarlibStart()
}
connect(jarlibDownloadJob.get(), SIGNAL(succeeded()), SLOT(jarlibFinished()));
- connect(jarlibDownloadJob.get(), SIGNAL(failed()), SLOT(jarlibFailed()));
+ connect(jarlibDownloadJob.get(), &NetJob::failed, this, &OneSixUpdate::jarlibFailed);
connect(jarlibDownloadJob.get(), SIGNAL(progress(qint64, qint64)),
SIGNAL(progress(qint64, qint64)));
@@ -336,12 +336,12 @@ void OneSixUpdate::jarlibFinished()
}
}
-void OneSixUpdate::jarlibFailed()
+void OneSixUpdate::jarlibFailed(QString reason)
{
QStringList failed = jarlibDownloadJob->getFailedFiles();
QString failed_all = failed.join("\n");
emitFailed(
- tr("Failed to download the following files:\n%1\n\nPlease try again.").arg(failed_all));
+ tr("Failed to download the following files:\n%1\n\nReason:%2\nPlease try again.").arg(failed_all, reason));
}
void OneSixUpdate::fmllibsStart()
@@ -400,7 +400,7 @@ void OneSixUpdate::fmllibsStart()
}
connect(dljob, SIGNAL(succeeded()), SLOT(fmllibsFinished()));
- connect(dljob, SIGNAL(failed()), SLOT(fmllibsFailed()));
+ connect(dljob, &NetJob::failed, this, &OneSixUpdate::fmllibsFailed);
connect(dljob, SIGNAL(progress(qint64, qint64)), SIGNAL(progress(qint64, qint64)));
legacyDownloadJob.reset(dljob);
legacyDownloadJob->start();
@@ -437,9 +437,9 @@ void OneSixUpdate::fmllibsFinished()
assetIndexStart();
}
-void OneSixUpdate::fmllibsFailed()
+void OneSixUpdate::fmllibsFailed(QString reason)
{
- emitFailed("Game update failed: it was impossible to fetch the required FML libraries.");
+ emitFailed(tr("Game update failed: it was impossible to fetch the required FML libraries.\nReason:\n%1").arg(reason));
return;
}
diff --git a/logic/minecraft/OneSixUpdate.h b/logic/minecraft/OneSixUpdate.h
index c8c3b03f..6901e3d6 100644
--- a/logic/minecraft/OneSixUpdate.h
+++ b/logic/minecraft/OneSixUpdate.h
@@ -40,18 +40,18 @@ slots:
void jarlibStart();
void jarlibFinished();
- void jarlibFailed();
+ void jarlibFailed(QString reason);
void fmllibsStart();
void fmllibsFinished();
- void fmllibsFailed();
+ void fmllibsFailed(QString reason);
void assetIndexStart();
void assetIndexFinished();
- void assetIndexFailed();
+ void assetIndexFailed(QString reason);
void assetsFinished();
- void assetsFailed();
+ void assetsFailed(QString reason);
private:
NetJobPtr jarlibDownloadJob;