mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 05:07:46 +02:00
Add settings to control the if prism should move the downloaded mods
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@ -288,6 +288,8 @@ void BlockedModsDialog::checkMatchHash(QString hash, QString path)
|
||||
|
||||
qDebug() << "[Blocked Mods Dialog] Checking for match on hash: " << hash << "| From path:" << path;
|
||||
|
||||
auto downloadDir = QFileInfo(APPLICATION->settings()->get("DownloadsDir").toString()).absoluteFilePath();
|
||||
auto moveFiles = APPLICATION->settings()->get("MoveModsFromDownloadsDir").toBool();
|
||||
for (auto& mod : m_mods) {
|
||||
if (mod.matched) {
|
||||
continue;
|
||||
@ -295,6 +297,9 @@ void BlockedModsDialog::checkMatchHash(QString hash, QString path)
|
||||
if (mod.hash.compare(hash, Qt::CaseInsensitive) == 0) {
|
||||
mod.matched = true;
|
||||
mod.localPath = path;
|
||||
if (moveFiles) {
|
||||
mod.move = QFileInfo(path).absoluteFilePath().startsWith(downloadDir);
|
||||
}
|
||||
match = true;
|
||||
|
||||
qDebug() << "[Blocked Mods Dialog] Hash match found:" << mod.name << hash << "| From path:" << path;
|
||||
@ -346,6 +351,8 @@ bool BlockedModsDialog::checkValidPath(QString path)
|
||||
return fsName.compare(metaName) == 0;
|
||||
};
|
||||
|
||||
auto downloadDir = QFileInfo(APPLICATION->settings()->get("DownloadsDir").toString()).absoluteFilePath();
|
||||
auto moveFiles = APPLICATION->settings()->get("MoveModsFromDownloadsDir").toBool();
|
||||
for (auto& mod : m_mods) {
|
||||
if (compare(filename, mod.name)) {
|
||||
// if the mod is not yet matched and doesn't have a hash then
|
||||
@ -353,6 +360,9 @@ bool BlockedModsDialog::checkValidPath(QString path)
|
||||
if (!mod.matched && mod.hash.isEmpty()) {
|
||||
mod.matched = true;
|
||||
mod.localPath = path;
|
||||
if (moveFiles) {
|
||||
mod.move = QFileInfo(path).absoluteFilePath().startsWith(downloadDir);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
qDebug() << "[Blocked Mods Dialog] Name match found:" << mod.name << "| From path:" << path;
|
||||
|
Reference in New Issue
Block a user