2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Implement close to taskbar option

This commit is contained in:
Ilya Fedin
2021-09-13 03:13:13 +04:00
committed by John Preston
parent ce256161f1
commit e92ae40ecb
11 changed files with 82 additions and 7 deletions

View File

@@ -315,12 +315,18 @@ bool GenerateDesktopFile(
fileText = fileText.replace(
QRegularExpression(
qsl("^Exec=.*$"),
qsl("^Exec=telegram-desktop(.*)$"),
QRegularExpression::MultilineOption),
qsl("Exec=%1 -workdir %2").arg(
qsl("Exec=%1 -workdir %2\\1").arg(
EscapeShellInLauncher(cExeDir() + cExeName()),
EscapeShellInLauncher(cWorkingDir()))
+ (args.isEmpty() ? QString() : ' ' + args));
EscapeShellInLauncher(cWorkingDir())));
fileText = fileText.replace(
QRegularExpression(
qsl("^Exec=(.*) -- %u$"),
QRegularExpression::MultilineOption),
qsl("Exec=\\1%1").arg(
args.isEmpty() ? QString() : ' ' + args));
target.write(fileText.toUtf8());
target.close();