mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-30 14:17:45 +00: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:
@@ -346,12 +346,16 @@ bool GenerateServiceFile(bool silent = false) {
|
|||||||
"Name",
|
"Name",
|
||||||
QGuiApplication::desktopFileName().toStdString());
|
QGuiApplication::desktopFileName().toStdString());
|
||||||
|
|
||||||
|
QStringList exec;
|
||||||
|
exec.append(executable);
|
||||||
|
if (Core::Launcher::Instance().customWorkingDir()) {
|
||||||
|
exec.append(u"-workdir"_q);
|
||||||
|
exec.append(cWorkingDir());
|
||||||
|
}
|
||||||
target->set_string(
|
target->set_string(
|
||||||
group,
|
group,
|
||||||
"Exec",
|
"Exec",
|
||||||
KShell::joinArgs({ executable }).replace(
|
KShell::joinArgs(exec).toStdString());
|
||||||
'\\',
|
|
||||||
qstr("\\\\")).toStdString());
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
target->save_to_file(targetFile.toStdString());
|
target->save_to_file(targetFile.toStdString());
|
||||||
|
Reference in New Issue
Block a user