delete duplicate mods
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
3d84635b24
commit
60a7628dbb
@ -49,11 +49,17 @@ class BasicFolderLoadTask : public Task {
|
||||
connect(this, &Task::finished, this->thread(), &QThread::quit);
|
||||
|
||||
m_dir.refresh();
|
||||
QStringList names;
|
||||
for (auto entry : m_dir.entryInfoList()) {
|
||||
auto resource = m_create_func(entry);
|
||||
if (names.contains(resource->name())) {
|
||||
resource->destroy();
|
||||
} else {
|
||||
names << resource->name();
|
||||
resource->moveToThread(m_thread_to_spawn_into);
|
||||
m_result->resources.insert(resource->internal_id(), resource);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_aborted)
|
||||
emit finished();
|
||||
|
@ -62,9 +62,15 @@ void ModFolderLoadTask::executeTask()
|
||||
|
||||
// Read JAR files that don't have metadata
|
||||
m_mods_dir.refresh();
|
||||
QStringList names;
|
||||
for (auto entry : m_mods_dir.entryInfoList()) {
|
||||
Mod* mod(new Mod(entry));
|
||||
|
||||
if (names.contains(mod->name())) {
|
||||
mod->destroy(m_index_dir, true);
|
||||
continue;
|
||||
}
|
||||
names << mod->name();
|
||||
if (mod->enabled()) {
|
||||
if (m_result->mods.contains(mod->internal_id())) {
|
||||
m_result->mods[mod->internal_id()]->setStatus(ModStatus::Installed);
|
||||
|
Loading…
Reference in New Issue
Block a user