aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform
diff options
context:
space:
mode:
authorflow <flowlnlnln@gmail.com>2022-08-21 10:00:23 -0300
committerflow <flowlnlnln@gmail.com>2022-09-20 18:36:10 -0300
commitddde885084a8eba61e691974edbc75186438ed55 (patch)
tree818ed25fe886d9e3c1858278e5011e9300aecb31 /launcher/modplatform
parentbe8c6f218cfe3acc31335305bb40284f8f6cb582 (diff)
downloadPrismLauncher-ddde885084a8eba61e691974edbc75186438ed55.tar.gz
PrismLauncher-ddde885084a8eba61e691974edbc75186438ed55.tar.bz2
PrismLauncher-ddde885084a8eba61e691974edbc75186438ed55.zip
fix: show warning in case there's no old index when updating
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/modplatform')
-rw-r--r--launcher/modplatform/flame/FlameInstanceCreationTask.cpp11
-rw-r--r--launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp11
2 files changed, 22 insertions, 0 deletions
diff --git a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
index a0eda1b0..1b282770 100644
--- a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
+++ b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
@@ -195,6 +195,17 @@ bool FlameCreationTask::updateInstance()
loop.exec();
m_process_update_file_info_job = nullptr;
+ } else {
+ // We don't have an old index file, so we may duplicate stuff!
+ auto dialog = CustomMessageBox::selectable(m_parent,
+ tr("No index file."),
+ tr("We couldn't find a suitable index file for the older version. This may cause some of the files to be duplicated. Do you want to continue?"),
+ QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Cancel);
+
+ if (dialog->exec() == QDialog::DialogCode::Rejected) {
+ m_abort = true;
+ return false;
+ }
}
setOverride(true);
diff --git a/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp b/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp
index d4c37cb9..c1898dd9 100644
--- a/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp
+++ b/launcher/modplatform/modrinth/ModrinthInstanceCreationTask.cpp
@@ -135,6 +135,17 @@ bool ModrinthCreationTask::updateInstance()
qDebug() << "Scheduling" << entry << "for removal";
m_files_to_remove.append(old_minecraft_dir.absoluteFilePath(entry));
}
+ } else {
+ // We don't have an old index file, so we may duplicate stuff!
+ auto dialog = CustomMessageBox::selectable(m_parent,
+ tr("No index file."),
+ tr("We couldn't find a suitable index file for the older version. This may cause some of the files to be duplicated. Do you want to continue?"),
+ QMessageBox::Warning, QMessageBox::Ok | QMessageBox::Cancel);
+
+ if (dialog->exec() == QDialog::DialogCode::Rejected) {
+ m_abort = true;
+ return false;
+ }
}