mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-01 02:46:59 +03:00
mark files as duplicate
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
2d51008304
commit
d2510b851b
5 changed files with 49 additions and 16 deletions
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "ModFolderLoadTask.h"
|
||||
|
||||
#include "FileSystem.h"
|
||||
#include "minecraft/mod/MetadataHandler.h"
|
||||
|
||||
#include <QThread>
|
||||
|
|
@ -62,15 +63,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()) {
|
||||
auto filePath = entry.absoluteFilePath();
|
||||
auto newFilePath = FS::getUniqueResourceName(filePath);
|
||||
if (newFilePath != filePath) {
|
||||
FS::move(filePath, newFilePath);
|
||||
entry = QFileInfo(newFilePath);
|
||||
}
|
||||
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…
Add table
Add a link
Reference in a new issue