From ddde885084a8eba61e691974edbc75186438ed55 Mon Sep 17 00:00:00 2001 From: flow Date: Sun, 21 Aug 2022 10:00:23 -0300 Subject: fix: show warning in case there's no old index when updating Signed-off-by: flow --- .../modplatform/modrinth/ModrinthInstanceCreationTask.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'launcher/modplatform/modrinth') 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; + } } -- cgit