Skip heroic games and unquotable paths in removeMissingGames

This commit is contained in:
Marco Allegretti 2026-03-23 13:05:08 +01:00
parent 66d80b0eea
commit 8e2fedccfb

View file

@ -1255,19 +1255,20 @@ void App::removeMissingGames()
// Skip URL-based launchers (Steam, Lutris, etc.) // Skip URL-based launchers (Steam, Lutris, etc.)
if (launchCommand.startsWith(QLatin1String("steam://")) || launchCommand.startsWith(QLatin1String("lutris:")) if (launchCommand.startsWith(QLatin1String("steam://")) || launchCommand.startsWith(QLatin1String("lutris:"))
|| launchCommand.startsWith(QLatin1String("xdg-open")) || launchCommand.startsWith(QLatin1String("flatpak run")) || launchCommand.startsWith(QLatin1String("xdg-open")) || launchCommand.startsWith(QLatin1String("flatpak run"))
|| launchCommand.startsWith(QLatin1String("legendary launch")) || launchCommand.startsWith(QLatin1String("bottles"))) { || launchCommand.startsWith(QLatin1String("legendary launch")) || launchCommand.startsWith(QLatin1String("bottles"))
|| launchCommand.startsWith(QLatin1String("heroic "))) {
continue; continue;
} }
// Extract executable path from command // Extract executable path from command
QString executable = launchCommand; QString executable = launchCommand;
// Handle quoted paths
if (executable.startsWith(QLatin1Char('"'))) { if (executable.startsWith(QLatin1Char('"'))) {
int endQuote = executable.indexOf(QLatin1Char('"'), 1); int endQuote = executable.indexOf(QLatin1Char('"'), 1);
if (endQuote > 0) { if (endQuote <= 0) {
executable = executable.mid(1, endQuote - 1); continue;
} }
executable = executable.mid(1, endQuote - 1);
} else { } else {
// Take first word as executable // Take first word as executable
int space = executable.indexOf(QLatin1Char(' ')); int space = executable.indexOf(QLatin1Char(' '));