From fef3cdd2cf24b4e6cfc8baf796f403f0658ab86d Mon Sep 17 00:00:00 2001 From: Missake212 Date: Sat, 29 Mar 2025 05:16:58 +0000 Subject: [PATCH] fix open update folder --- src/qt_gui/gui_context_menus.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/qt_gui/gui_context_menus.h b/src/qt_gui/gui_context_menus.h index 7dcb006ba..b5732d0ca 100644 --- a/src/qt_gui/gui_context_menus.h +++ b/src/qt_gui/gui_context_menus.h @@ -140,15 +140,17 @@ public: QString open_update_path; Common::FS::PathToQString(open_update_path, m_games[itemID].path); open_update_path += "-UPDATE"; - if (!std::filesystem::exists(Common::FS::PathFromQString(open_update_path))) { + if (std::filesystem::exists(Common::FS::PathFromQString(open_update_path))) { + QDesktopServices::openUrl(QUrl::fromLocalFile(open_update_path)); + } else { Common::FS::PathToQString(open_update_path, m_games[itemID].path); open_update_path += "-patch"; - if (!std::filesystem::exists(Common::FS::PathFromQString(open_update_path))) { + if (std::filesystem::exists(Common::FS::PathFromQString(open_update_path))) { + QDesktopServices::openUrl(QUrl::fromLocalFile(open_update_path)); + } else { QMessageBox::critical(nullptr, tr("Error"), QString(tr("This game has no update folder to open!"))); } - } else { - QDesktopServices::openUrl(QUrl::fromLocalFile(open_update_path)); } }