Fix oversights and make requested changes

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2026-01-06 19:21:04 +00:00
parent e4991d81d7
commit 3a7366a998
3 changed files with 15 additions and 12 deletions

View File

@@ -335,17 +335,20 @@ bool ResourceFolderModel::update()
},
Qt::ConnectionType::QueuedConnection);
auto task = new SequentialTask("ResourceFolderModel::update");
Task::Ptr preUpdate{createPreUpdateTask()};
if (preUpdate != nullptr) {
auto task = new SequentialTask("ResourceFolderModel::update");
Task::Ptr preUpdate(createPreUpdateTask());
if (preUpdate != nullptr)
task->addTask(preUpdate);
task->addTask(m_current_update_task);
task->addTask(m_current_update_task);
connect(task, &Task::finished, [task] { task->deleteLater(); });
connect(task, &Task::finished, [task] { task->deleteLater(); });
QThreadPool::globalInstance()->start(task);
QThreadPool::globalInstance()->start(task);
} else {
QThreadPool::globalInstance()->start(m_current_update_task.get());
}
return true;
}

View File

@@ -1,3 +1,4 @@
#include "FileSystem.h"
#include "ShaderPackFolderModel.h"
namespace {
@@ -21,21 +22,20 @@ class ShaderPackIndexMigrateTask : public Task {
QString src = m_indexDir.filePath(file);
QString dest = m_resourceDir.filePath(file);
if (QFile::rename(src, dest)) {
if (FS::move(src, dest)) {
qDebug() << "Moved" << src << "to" << dest;
} else {
movedAll = false;
qDebug() << "Error moving" << src << "to" << dest;
}
}
if (!movedAll) {
// FIXME: not shown in the UI
emitFailed(tr("Failed to migrate everything from .index"));
emitFailed(tr("Failed to migrate shaderpack metadata from .index"));
return;
}
if (FS::deletePath(m_indexDir.absolutePath())) {
if (!FS::deletePath(m_indexDir.absolutePath())) {
emitFailed(tr("Failed to remove old .index dir"));
return;
}

View File

@@ -112,7 +112,7 @@ ExportPackDialog::ExportPackDialog(MinecraftInstancePtr instance, QWidget* paren
continue;
}
if (resourceModel->indexDir() == resourceModel->indexDir()) {
if (resourceModel->dir() == resourceModel->indexDir()) {
continue;
}