mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2024-10-06 06:50:16 +00:00
NOISSUE shortcut creation: enclose paths in quotes
This commit is contained in:
parent
79910e3542
commit
518b19e667
@ -129,7 +129,7 @@ void CreateShortcutDialog::updateDialogState()
|
|||||||
|
|
||||||
QString CreateShortcutDialog::getLaunchCommand()
|
QString CreateShortcutDialog::getLaunchCommand()
|
||||||
{
|
{
|
||||||
return QDir::toNativeSeparators(QCoreApplication::applicationFilePath())
|
return "\"" + QDir::toNativeSeparators(QCoreApplication::applicationFilePath()) + "\""
|
||||||
+ getLaunchArgs();
|
+ getLaunchArgs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ void CreateShortcutDialog::createShortcut()
|
|||||||
if (ui->createScriptCheckBox->isChecked())
|
if (ui->createScriptCheckBox->isChecked())
|
||||||
{
|
{
|
||||||
shortcutText = "#!/bin/sh\n"
|
shortcutText = "#!/bin/sh\n"
|
||||||
"cd " + QCoreApplication::applicationDirPath() + "\n"
|
"cd \"" + QCoreApplication::applicationDirPath() + "\"\n"
|
||||||
+ getLaunchCommand() + " &\n";
|
+ getLaunchCommand() + " &\n";
|
||||||
} else
|
} else
|
||||||
// freedesktop.org desktop entry
|
// freedesktop.org desktop entry
|
||||||
@ -179,7 +179,7 @@ void CreateShortcutDialog::createShortcut()
|
|||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// Windows batch script implementation
|
// Windows batch script implementation
|
||||||
shortcutText = "@ECHO OFF\r\n"
|
shortcutText = "@ECHO OFF\r\n"
|
||||||
"CD " + QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "\r\n"
|
"CD \"" + QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "\"\r\n"
|
||||||
"START /B " + getLaunchCommand() + "\r\n";
|
"START /B " + getLaunchCommand() + "\r\n";
|
||||||
#endif
|
#endif
|
||||||
QFile shortcutFile(ui->shortcutPath->text());
|
QFile shortcutFile(ui->shortcutPath->text());
|
||||||
|
Loading…
Reference in New Issue
Block a user