aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-09-03 13:25:05 -0300
committerflow <flowlnlnln@gmail.com>2022-09-03 13:37:22 -0300
commit42c81395b362b9a080dca3f9d62e33c547cb8259 (patch)
treed4917be6579ed036e21489debfd22e6da50f9ee4 /launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp
parent3b13e692d29c96f99b2c153dd2c7933070eb8479 (diff)
downloadPrismLauncher-42c81395b362b9a080dca3f9d62e33c547cb8259.tar.gz
PrismLauncher-42c81395b362b9a080dca3f9d62e33c547cb8259.tar.bz2
PrismLauncher-42c81395b362b9a080dca3f9d62e33c547cb8259.zip
fix: race condition on ResourceFolderModel tests
This (hopefully) fixes the race contiditions that sometimes got triggered in tests. Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp')
-rw-r--r--launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp b/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp
index a56ba8ab..3a857740 100644
--- a/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp
+++ b/launcher/minecraft/mod/tasks/ModFolderLoadTask.cpp
@@ -38,8 +38,8 @@
#include "minecraft/mod/MetadataHandler.h"
-ModFolderLoadTask::ModFolderLoadTask(QDir mods_dir, QDir index_dir, bool is_indexed, bool clean_orphan, QObject* parent)
- : Task(parent, false), m_mods_dir(mods_dir), m_index_dir(index_dir), m_is_indexed(is_indexed), m_clean_orphan(clean_orphan), m_result(new Result())
+ModFolderLoadTask::ModFolderLoadTask(QDir mods_dir, QDir index_dir, bool is_indexed, bool clean_orphan)
+ : Task(nullptr, false), m_mods_dir(mods_dir), m_index_dir(index_dir), m_is_indexed(is_indexed), m_clean_orphan(clean_orphan), m_result(new Result())
{}
void ModFolderLoadTask::executeTask()
@@ -96,7 +96,10 @@ void ModFolderLoadTask::executeTask()
}
}
- emitSucceeded();
+ if (m_aborted)
+ emit finished();
+ else
+ emitSucceeded();
}
void ModFolderLoadTask::getFromMetadata()