mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Fix D-Bus service with non-standard workdir or backslash in the path
Working dir not set leads to unrelevant instance being launched with unrelevant bus name and entire launchf fails. D-Bus service files also don't need backslash escaping unlike the .desktop files.
This commit is contained in:
parent
2cc0faa5b3
commit
30c73fbdf2
1 changed files with 7 additions and 3 deletions
|
@ -346,12 +346,16 @@ bool GenerateServiceFile(bool silent = false) {
|
|||
"Name",
|
||||
QGuiApplication::desktopFileName().toStdString());
|
||||
|
||||
QStringList exec;
|
||||
exec.append(executable);
|
||||
if (Core::Launcher::Instance().customWorkingDir()) {
|
||||
exec.append(u"-workdir"_q);
|
||||
exec.append(cWorkingDir());
|
||||
}
|
||||
target->set_string(
|
||||
group,
|
||||
"Exec",
|
||||
KShell::joinArgs({ executable }).replace(
|
||||
'\\',
|
||||
qstr("\\\\")).toStdString());
|
||||
KShell::joinArgs(exec).toStdString());
|
||||
|
||||
try {
|
||||
target->save_to_file(targetFile.toStdString());
|
||||
|
|
Loading…
Add table
Reference in a new issue