mirror of
https://github.com/MultiMC/MultiMC5.git
synced 2025-02-03 20:54:14 +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()
|
||||
{
|
||||
return QDir::toNativeSeparators(QCoreApplication::applicationFilePath())
|
||||
return "\"" + QDir::toNativeSeparators(QCoreApplication::applicationFilePath()) + "\""
|
||||
+ getLaunchArgs();
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ void CreateShortcutDialog::createShortcut()
|
||||
if (ui->createScriptCheckBox->isChecked())
|
||||
{
|
||||
shortcutText = "#!/bin/sh\n"
|
||||
"cd " + QCoreApplication::applicationDirPath() + "\n"
|
||||
"cd \"" + QCoreApplication::applicationDirPath() + "\"\n"
|
||||
+ getLaunchCommand() + " &\n";
|
||||
} else
|
||||
// freedesktop.org desktop entry
|
||||
@ -179,7 +179,7 @@ void CreateShortcutDialog::createShortcut()
|
||||
#ifdef Q_OS_WIN
|
||||
// Windows batch script implementation
|
||||
shortcutText = "@ECHO OFF\r\n"
|
||||
"CD " + QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "\r\n"
|
||||
"CD \"" + QDir::toNativeSeparators(QCoreApplication::applicationDirPath()) + "\"\r\n"
|
||||
"START /B " + getLaunchCommand() + "\r\n";
|
||||
#endif
|
||||
QFile shortcutFile(ui->shortcutPath->text());
|
||||
|
Loading…
x
Reference in New Issue
Block a user