Fix the "Open Update Folder" for folders ending with "-patch" (#2712)

* fix open update folder

* Update gui_context_menus.h
This commit is contained in:
Missake212 2025-03-29 08:32:57 +00:00 committed by GitHub
parent be7d646e83
commit df9151481c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -141,14 +141,16 @@ public:
Common::FS::PathToQString(open_update_path, m_games[itemID].path);
open_update_path += "-UPDATE";
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))) {
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));
}
}