Merge pull request #269 from DanielSvoboda/fix-shortcut-name-with-unaccepted-characters

fix shortcut name with unaccepted characters
This commit is contained in:
georgemoralis 2024-07-09 10:04:47 +03:00 committed by GitHub
commit f420e33592
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -141,13 +141,17 @@ public:
QString exePath; QString exePath;
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
linkPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/" + 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("\\", "/"); exePath = QCoreApplication::applicationFilePath().replace("\\", "/");
#else #else
linkPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/" + linkPath = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/" +
QString::fromStdString(m_games[itemID].name) + ".desktop"; QString::fromStdString(m_games[itemID].name)
.remove(QRegularExpression("[\\\\/:*?\"<>|]")) +
".desktop";
#endif #endif
// Convert the icon to .ico if necessary // Convert the icon to .ico if necessary