try to blind fix autostarting for linux, now should also take all CLI args into account when generating desktop file
This commit is contained in:
parent
d91b2927ce
commit
6bde01321f
@ -4,7 +4,7 @@ Type=Application
|
|||||||
Terminal=false
|
Terminal=false
|
||||||
Name=RSS Guard
|
Name=RSS Guard
|
||||||
TryExec=%1
|
TryExec=%1
|
||||||
Exec=%1
|
Exec=%2
|
||||||
Hidden=false
|
Hidden=false
|
||||||
X-GNOME-Autostart-Delay=15
|
X-GNOME-Autostart-Delay=15
|
||||||
X-LXQt-Need-Tray=true
|
X-LXQt-Need-Tray=true
|
@ -175,11 +175,27 @@ bool SystemFactory::setAutoStartStatus(AutoStartStatus new_status) {
|
|||||||
try {
|
try {
|
||||||
QString desktop_file_contents = QString::fromUtf8(IOFactory::readFile(source_autostart_desktop_file));
|
QString desktop_file_contents = QString::fromUtf8(IOFactory::readFile(source_autostart_desktop_file));
|
||||||
|
|
||||||
#if defined(IS_FLATPAK_BUILD)
|
QStringList args = qApp->rawCliArgs();
|
||||||
desktop_file_contents = desktop_file_contents.arg(QSL("flatpak run %1").arg(QSL(APP_REVERSE_NAME)));
|
auto std_args = boolinq::from(args)
|
||||||
#else
|
.select([](const QString& arg) {
|
||||||
desktop_file_contents = desktop_file_contents.arg(QSL(APP_LOW_NAME));
|
if (arg.contains(QL1S(" ")) && !arg.startsWith(QL1S("\""))) {
|
||||||
#endif
|
return QSL("\"%1\"").arg(arg);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return arg;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.toStdList();
|
||||||
|
args = FROM_STD_LIST(QStringList, std_args);
|
||||||
|
|
||||||
|
QString app_run_line = args.join(QL1C(' '));
|
||||||
|
desktop_file_contents = desktop_file_contents.arg(args.at(0), app_run_line);
|
||||||
|
|
||||||
|
// #if defined(IS_FLATPAK_BUILD)
|
||||||
|
// desktop_file_contents = desktop_file_contents.arg(QSL("flatpak run %1").arg(QSL(APP_REVERSE_NAME)));
|
||||||
|
// #else
|
||||||
|
// desktop_file_contents = desktop_file_contents.arg(QSL(APP_LOW_NAME));
|
||||||
|
// #endif
|
||||||
|
|
||||||
IOFactory::writeFile(destination_file, desktop_file_contents.toUtf8());
|
IOFactory::writeFile(destination_file, desktop_file_contents.toUtf8());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user