aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/modplatform')
-rw-r--r--launcher/modplatform/flame/FlameInstanceCreationTask.cpp11
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.cpp24
2 files changed, 17 insertions, 18 deletions
diff --git a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
index 5d4dc689..f86e9335 100644
--- a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
+++ b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
@@ -413,15 +413,14 @@ void FlameCreationTask::idResolverSucceeded(QEventLoop& loop)
/// @brief copy the matched blocked mods to the instance staging area
/// @param blocked_mods list of the blocked mods and their matched paths
-void FlameCreationTask::copyBlockedMods(QList<BlockedMod> const& blocked_mods) {
-
+void FlameCreationTask::copyBlockedMods(QList<BlockedMod> const& blocked_mods)
+{
setStatus(tr("Copying Blocked Mods..."));
setAbortable(false);
int i = 0;
int total = blocked_mods.length();
setProgress(i, total);
- for (auto &mod : blocked_mods) {
-
+ for (auto const& mod : blocked_mods) {
if (!mod.matched) {
qDebug() << mod.name << "was not matched to a local file, skipping copy";
continue;
@@ -433,9 +432,9 @@ void FlameCreationTask::copyBlockedMods(QList<BlockedMod> const& blocked_mods) {
qDebug() << "Will try to copy" << mod.localPath << "to" << dest_path;
- if (!FS::copy(mod.localPath, dest_path)()) {
+ if (!FS::copy(mod.localPath, dest_path)()) {
qDebug() << "Copy of" << mod.localPath << "to" << dest_path << "Failed";
- }
+ }
i++;
setProgress(i, total);
diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
index 1e4bbe19..70ef7571 100644
--- a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
+++ b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
@@ -353,31 +353,31 @@ void PackInstallTask::onModDownloadFailed(QString reason)
}
/// @brief copy the matched blocked mods to the instance staging area
-void PackInstallTask::copyBlockedMods() {
-
+void PackInstallTask::copyBlockedMods()
+{
setStatus(tr("Copying Blocked Mods..."));
setAbortable(false);
int i = 0;
int total = m_blocked_mods.length();
setProgress(i, total);
- for (auto mod = m_blocked_mods.begin(); mod != m_blocked_mods.end(); mod++, i++) {
-
- if (!mod->matched) {
- qDebug() << mod->name << "was not matched to a local file, skipping copy";
+ for (auto const& mod : m_blocked_mods) {
+ if (!mod.matched) {
+ qDebug() << mod.name << "was not matched to a local file, skipping copy";
continue;
}
- auto dest_path = FS::PathCombine(m_stagingPath, ".minecraft", "mods", mod->name);
+ auto dest_path = FS::PathCombine(m_stagingPath, ".minecraft", "mods", mod.name);
setStatus(tr("Copying Blocked Mods (%1 out of %2 are done)").arg(QString::number(i), QString::number(total)));
- qDebug() << "Will try to copy" << mod->localPath << "to" << dest_path;
+ qDebug() << "Will try to copy" << mod.localPath << "to" << dest_path;
- if (!FS::copy(mod->localPath, dest_path)()) {
- qDebug() << "Copy of" << mod->localPath << "to" << dest_path << "Failed";
- }
+ if (!FS::copy(mod.localPath, dest_path)()) {
+ qDebug() << "Copy of" << mod.localPath << "to" << dest_path << "Failed";
+ }
- setProgress(i+1, total);
+ i++;
+ setProgress(i, total);
}
setAbortable(true);