From aef6d2e488e29e4fa75d4340527f94518248c8fe Mon Sep 17 00:00:00 2001 From: DanielSvoboda Date: Tue, 9 Jul 2024 00:55:48 -0300 Subject: [PATCH] fix shortcut name with unaccepted characters --- src/qt_gui/gui_context_menus.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qt_gui/gui_context_menus.h b/src/qt_gui/gui_context_menus.h index 76156446..8c10a10c 100644 --- a/src/qt_gui/gui_context_menus.h +++ b/src/qt_gui/gui_context_menus.h @@ -141,13 +141,17 @@ public: QString exePath; #ifdef Q_OS_WIN linkPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/" + - QString::fromStdString(m_games[itemID].name) + ".lnk"; + QString::fromStdString(m_games[itemID].name) + .remove(QRegularExpression("[\\\\/:*?\"<>|]")) + + ".lnk"; exePath = QCoreApplication::applicationFilePath().replace("\\", "/"); #else linkPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/" + - QString::fromStdString(m_games[itemID].name) + ".desktop"; + QString::fromStdString(m_games[itemID].name) + .remove(QRegularExpression("[\\\\/:*?\"<>|]")) + + ".desktop"; #endif // Convert the icon to .ico if necessary