Fix steam shortcut creation

pull/130/head
Peter Repukat 3 years ago
parent 00e6d17714
commit f657dd6c4c

@ -51,8 +51,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,7002809
PRODUCTVERSION 0,0,0,7002809
FILEVERSION 0,0,0,0006017
PRODUCTVERSION 0,0,0,0006017
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -69,12 +69,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Peter Repukat - FlatspotSoftware"
VALUE "FileDescription", "GlosSI - Config"
VALUE "FileVersion", "0.0.0.7ae28a9"
VALUE "FileVersion", "0.0.0.00e6d17"
VALUE "InternalName", "GlosSIConfig"
VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware"
VALUE "OriginalFilename", "GlosSIConfig.exe"
VALUE "ProductName", "GlosSi"
VALUE "ProductVersion", "0.0.0.7ae28a9"
VALUE "ProductVersion", "0.0.0.00e6d17"
END
END
BLOCK "VarFileInfo"
@ -162,6 +162,30 @@ END

@ -147,7 +147,7 @@ bool UIModel::isInSteam(QVariant shortcut)
bool UIModel::addToSteam(QVariant shortcut)
{
QDir appDir = QDir::current();
QDir appDir = QGuiApplication::applicationDirPath();
const auto map = shortcut.toMap();
const auto name = map["name"].toString();
const auto maybeLaunchPath = map["launchPath"].toString();
@ -174,10 +174,20 @@ bool UIModel::addToSteam(QVariant shortcut)
auto maybeIcon = map["icon"].toString();
if (maybeIcon.isEmpty()) {
if (launch && !maybeLaunchPath.isEmpty())
vdfshortcut.icon.value = maybeLaunchPath.toStdString();
vdfshortcut.icon.value =
"\"" + (
is_windows_
? QString(maybeLaunchPath).replace(QRegularExpression("\/"), "\\").toStdString()
: maybeLaunchPath.toStdString()
) + "\"";
}
else {
vdfshortcut.icon.value = maybeIcon.toStdString();
vdfshortcut.icon.value =
"\"" + (
is_windows_
? QString(maybeIcon).replace(QRegularExpression("\/"), "\\").toStdString()
: maybeIcon.toStdString()
) + "\"";
}
// Add installed locally and GlosSI tag
VDFParser::ShortcutTag locallyTag;

Loading…
Cancel
Save