fix open update folder

This commit is contained in:
Missake212 2025-03-29 05:16:58 +00:00
parent 78c8bca2bb
commit fef3cdd2cf

View File

@ -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));
}
}