mirror of
https://github.com/PrismLauncher/PrismLauncher
synced 2026-04-23 09:05:03 +00:00
Fix oversights and make requested changes
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
e4991d81d7
commit
3a7366a998
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ ExportPackDialog::ExportPackDialog(MinecraftInstancePtr instance, QWidget* paren
|
|||
continue;
|
||||
}
|
||||
|
||||
if (resourceModel->indexDir() == resourceModel->indexDir()) {
|
||||
if (resourceModel->dir() == resourceModel->indexDir()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue