summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-19 09:47:32 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-03-12 18:19:39 +0100
commitf13b0b1f2e8598bf0382e9cb1639c5e9c87432a3 (patch)
tree2d50efe39321fce75467bdb6398d9fe8fc8b62d4
parent3c73e644a71d7ac7da873dca40f5dba43b16e6df (diff)
downloadsystemd-f13b0b1f2e8598bf0382e9cb1639c5e9c87432a3.tar.gz
xdg-autostart-generator: reindent
(cherry picked from commit 9f11f565556410f9484db9e4991f6c04eeafffc7) (cherry picked from commit 8479eb96c1d6c3039acb4e986cb59ef283aa67e9)
-rw-r--r--src/xdg-autostart-generator/xdg-autostart-service.c87
1 files changed, 41 insertions, 46 deletions
diff --git a/src/xdg-autostart-generator/xdg-autostart-service.c b/src/xdg-autostart-generator/xdg-autostart-service.c
index e14758dbda..3acbce11fa 100644
--- a/src/xdg-autostart-generator/xdg-autostart-service.c
+++ b/src/xdg-autostart-generator/xdg-autostart-service.c
@@ -320,33 +320,33 @@ XdgAutostartService *xdg_autostart_service_parse_desktop(const char *path) {
return NULL;
const ConfigTableItem items[] = {
- { "Desktop Entry", "Name", xdg_config_parse_string, 0, &service->description},
- { "Desktop Entry", "Exec", xdg_config_parse_string, 0, &service->exec_string},
- { "Desktop Entry", "Path", xdg_config_parse_string, 0, &service->working_directory},
- { "Desktop Entry", "TryExec", xdg_config_parse_string, 0, &service->try_exec},
- { "Desktop Entry", "Type", xdg_config_parse_string, 0, &service->type},
- { "Desktop Entry", "OnlyShowIn", xdg_config_parse_strv, 0, &service->only_show_in},
- { "Desktop Entry", "NotShowIn", xdg_config_parse_strv, 0, &service->not_show_in},
- { "Desktop Entry", "Hidden", xdg_config_parse_bool, 0, &service->hidden},
- { "Desktop Entry", "AutostartCondition", xdg_config_parse_string, 0, &service->autostart_condition},
- { "Desktop Entry", "X-KDE-autostart-condition", xdg_config_parse_string, 0, &service->kde_autostart_condition},
- { "Desktop Entry", "X-GNOME-Autostart-Phase", xdg_config_parse_string, 0, &service->gnome_autostart_phase},
- { "Desktop Entry", "X-systemd-skip", xdg_config_parse_bool, 0, &service->systemd_skip},
+ { "Desktop Entry", "Name", xdg_config_parse_string, 0, &service->description },
+ { "Desktop Entry", "Exec", xdg_config_parse_string, 0, &service->exec_string },
+ { "Desktop Entry", "Path", xdg_config_parse_string, 0, &service->working_directory },
+ { "Desktop Entry", "TryExec", xdg_config_parse_string, 0, &service->try_exec },
+ { "Desktop Entry", "Type", xdg_config_parse_string, 0, &service->type },
+ { "Desktop Entry", "OnlyShowIn", xdg_config_parse_strv, 0, &service->only_show_in },
+ { "Desktop Entry", "NotShowIn", xdg_config_parse_strv, 0, &service->not_show_in },
+ { "Desktop Entry", "Hidden", xdg_config_parse_bool, 0, &service->hidden },
+ { "Desktop Entry", "AutostartCondition", xdg_config_parse_string, 0, &service->autostart_condition },
+ { "Desktop Entry", "X-KDE-autostart-condition", xdg_config_parse_string, 0, &service->kde_autostart_condition },
+ { "Desktop Entry", "X-GNOME-Autostart-Phase", xdg_config_parse_string, 0, &service->gnome_autostart_phase },
+ { "Desktop Entry", "X-systemd-skip", xdg_config_parse_bool, 0, &service->systemd_skip },
/* Common entries that we do not use currently. */
- { "Desktop Entry", "Categories", NULL, 0, NULL},
- { "Desktop Entry", "Comment", NULL, 0, NULL},
- { "Desktop Entry", "Encoding", NULL, 0, NULL},
- { "Desktop Entry", "GenericName", NULL, 0, NULL},
- { "Desktop Entry", "Icon", NULL, 0, NULL},
- { "Desktop Entry", "Keywords", NULL, 0, NULL},
- { "Desktop Entry", "MimeType", NULL, 0, NULL},
- { "Desktop Entry", "NoDisplay", NULL, 0, NULL},
- { "Desktop Entry", "StartupNotify", NULL, 0, NULL},
- { "Desktop Entry", "StartupWMClass", NULL, 0, NULL},
- { "Desktop Entry", "Terminal", NULL, 0, NULL},
- { "Desktop Entry", "URL", NULL, 0, NULL},
- { "Desktop Entry", "Version", NULL, 0, NULL},
+ { "Desktop Entry", "Categories", NULL, 0, NULL},
+ { "Desktop Entry", "Comment", NULL, 0, NULL},
+ { "Desktop Entry", "Encoding", NULL, 0, NULL},
+ { "Desktop Entry", "GenericName", NULL, 0, NULL},
+ { "Desktop Entry", "Icon", NULL, 0, NULL},
+ { "Desktop Entry", "Keywords", NULL, 0, NULL},
+ { "Desktop Entry", "MimeType", NULL, 0, NULL},
+ { "Desktop Entry", "NoDisplay", NULL, 0, NULL},
+ { "Desktop Entry", "StartupNotify", NULL, 0, NULL},
+ { "Desktop Entry", "StartupWMClass", NULL, 0, NULL},
+ { "Desktop Entry", "Terminal", NULL, 0, NULL},
+ { "Desktop Entry", "URL", NULL, 0, NULL},
+ { "Desktop Entry", "Version", NULL, 0, NULL},
{}
};
@@ -375,20 +375,17 @@ int xdg_autostart_format_exec_start(
int r;
/*
- * Unfortunately, there is a mismatch between systemd's idea of $PATH
- * and XDGs. i.e. we need to ensure that we have an absolute path to
- * support cases where $PATH has been modified from the default set.
+ * Unfortunately, there is a mismatch between systemd's idea of $PATH and XDGs. I.e. we need to
+ * ensure that we have an absolute path to support cases where $PATH has been modified from the
+ * default set.
*
- * Note that this is only needed for development environments though;
- * so while it is important, this should have no effect in production
- * environments.
+ * Note that this is only needed for development environments though; so while it is important, this
+ * should have no effect in production environments.
*
- * To be compliant with the XDG specification, we also need to strip
- * certain parameters and such. Doing so properly makes parsing the
- * command line unavoidable.
+ * To be compliant with the XDG specification, we also need to strip certain parameters and
+ * such. Doing so properly makes parsing the command line unavoidable.
*
- * NOTE: Technically, XDG only specifies " as quotes, while this also
- * accepts '.
+ * NOTE: Technically, XDG only specifies " as quotes, while this also accepts '.
*/
exec_split = strv_split_full(exec, WHITESPACE, SPLIT_QUOTES | SPLIT_RELAX);
if (!exec_split)
@@ -424,28 +421,26 @@ int xdg_autostart_format_exec_start(
}
/*
- * Remove any standardised XDG fields; we assume they never appear as
- * part of another argument as that just does not make any sense as
- * they can be empty (GLib will e.g. turn "%f" into an empty argument).
- * Other implementations may handle this differently.
+ * Remove any standardised XDG fields; we assume they never appear as part of another
+ * argument as that just does not make any sense as they can be empty (GLib will e.g. turn
+ * "%f" into an empty argument). Other implementations may handle this differently.
*/
if (STR_IN_SET(c,
"%f", "%F",
"%u", "%U",
"%d", "%D",
"%n", "%N",
- "%i", /* Location of icon, could be implemented. */
- "%c", /* Translated application name, could be implemented. */
- "%k", /* Location of desktop file, could be implemented. */
+ "%i", /* Location of icon, could be implemented. */
+ "%c", /* Translated application name, could be implemented. */
+ "%k", /* Location of desktop file, could be implemented. */
"%v",
"%m"
))
continue;
/*
- * %% -> % and then % -> %% means that we correctly quote any %
- * and also quote any left over (and invalid) % specifier from
- * the desktop file.
+ * %% -> % and then % -> %% means that we correctly quote any % and also quote any left over
+ * (and invalid) % specifier from the desktop file.
*/
raw = strreplace(c, "%%", "%");
if (!raw)