Commit 25b53cc1 authored by Benjamin Berg's avatar Benjamin Berg Committed by Sebastian Geiger

main: Remove support for --autostart argument

This has been superseeded by the AutostartWhitelist key in the session
file.
parent 58e4af5c
......@@ -206,16 +206,8 @@ gsm_util_get_saved_session_dir (void)
return _saved_session_dir;
}
static char ** autostart_dirs;
void
gsm_util_set_autostart_dirs (char ** dirs)
{
autostart_dirs = g_strdupv (dirs);
}
static char **
gsm_util_get_standard_autostart_dirs (void)
char **
gsm_util_get_autostart_dirs ()
{
GPtrArray *dirs;
const char * const *system_config_dirs;
......@@ -247,16 +239,6 @@ gsm_util_get_standard_autostart_dirs (void)
return (char **) g_ptr_array_free (dirs, FALSE);
}
char **
gsm_util_get_autostart_dirs ()
{
if (autostart_dirs) {
return g_strdupv ((char **)autostart_dirs);
}
return gsm_util_get_standard_autostart_dirs ();
}
char **
gsm_util_get_app_dirs ()
{
......@@ -290,7 +272,6 @@ gsm_util_get_desktop_dirs (gboolean include_saved_session,
{
char **apps;
char **autostart;
char **standard_autostart;
char **result;
int size;
int i;
......@@ -298,18 +279,9 @@ gsm_util_get_desktop_dirs (gboolean include_saved_session,
apps = gsm_util_get_app_dirs ();
autostart = gsm_util_get_autostart_dirs ();
/* Still, check the standard autostart dirs for things like fulfilling session reqs,
* if using a non-standard autostart dir for autostarting */
if (autostart_dirs != NULL)
standard_autostart = gsm_util_get_standard_autostart_dirs ();
else
standard_autostart = NULL;
size = 0;
for (i = 0; apps[i] != NULL; i++) { size++; }
for (i = 0; autostart[i] != NULL; i++) { size++; }
if (autostart_dirs != NULL)
for (i = 0; standard_autostart[i] != NULL; i++) { size++; }
if (include_saved_session)
size += 1;
......@@ -324,11 +296,6 @@ gsm_util_get_desktop_dirs (gboolean include_saved_session,
for (i = 0; autostart[i] != NULL; i++, size++) {
result[size] = autostart[i];
}
if (standard_autostart != NULL) {
for (i = 0; standard_autostart[i] != NULL; i++, size++) {
result[size] = standard_autostart[i];
}
}
for (i = 0; apps[i] != NULL; i++, size++) {
result[size] = apps[i];
}
......@@ -336,11 +303,6 @@ gsm_util_get_desktop_dirs (gboolean include_saved_session,
for (i = 0; apps[i] != NULL; i++, size++) {
result[size] = apps[i];
}
if (standard_autostart != NULL) {
for (i = 0; standard_autostart[i] != NULL; i++, size++) {
result[size] = standard_autostart[i];
}
}
for (i = 0; autostart[i] != NULL; i++, size++) {
result[size] = autostart[i];
}
......@@ -351,7 +313,6 @@ gsm_util_get_desktop_dirs (gboolean include_saved_session,
g_free (apps);
g_free (autostart);
g_free (standard_autostart);
result[size] = NULL;
......
......@@ -35,7 +35,6 @@ const char *gsm_util_get_saved_session_dir (void);
gchar** gsm_util_get_app_dirs (void);
gchar** gsm_util_get_autostart_dirs (void);
void gsm_util_set_autostart_dirs (char **dirs);
gchar ** gsm_util_get_desktop_dirs (gboolean include_saved_session,
gboolean autostart_first);
......
......@@ -388,8 +388,6 @@ main (int argc, char **argv)
static char **override_autostart_dirs = NULL;
static char *opt_session_name = NULL;
const char *debug_string = NULL;
const char *env_override_autostart_dirs = NULL;
g_auto(GStrv) env_override_autostart_dirs_v = NULL;
gboolean gl_failed = FALSE;
guint name_owner_id;
GOptionContext *options;
......@@ -399,7 +397,7 @@ main (int argc, char **argv)
{ "systemd", 0, 0, G_OPTION_ARG_NONE, &use_systemd, N_("Use systemd session management"), NULL },
#endif
{ "builtin", 0, G_OPTION_FLAG_REVERSE, G_OPTION_ARG_NONE, &use_systemd, N_("Use builtin session management (rather than the systemd based one)"), NULL },
{ "autostart", 'a', 0, G_OPTION_ARG_STRING_ARRAY, &override_autostart_dirs, N_("Override standard autostart directories"), N_("AUTOSTART_DIR") },
{ "autostart", 'a', 0, G_OPTION_ARG_STRING_ARRAY, &override_autostart_dirs, N_("Ignored, use AutostartWhitelist in session file instead"), N_("AUTOSTART_DIR") },
{ "session", 0, 0, G_OPTION_ARG_STRING, &opt_session_name, N_("Session to use"), N_("SESSION_NAME") },
{ "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL },
{ "failsafe", 'f', 0, G_OPTION_ARG_NONE, &failsafe, N_("Do not load user-specified applications"), NULL },
......@@ -512,23 +510,6 @@ main (int argc, char **argv)
exit (1);
}
env_override_autostart_dirs = g_getenv ("GNOME_SESSION_AUTOSTART_DIR");
if (env_override_autostart_dirs != NULL && env_override_autostart_dirs[0] != '\0') {
env_override_autostart_dirs_v = g_strsplit (env_override_autostart_dirs, ":", 0);
gsm_util_set_autostart_dirs (env_override_autostart_dirs_v);
} else {
gsm_util_set_autostart_dirs (override_autostart_dirs);
/* Export the override autostart dirs parameter to the environment
* in case we are running on systemd. */
if (override_autostart_dirs) {
g_autofree char *autostart_dirs = NULL;
autostart_dirs = g_strjoinv (":", override_autostart_dirs);
g_setenv ("GNOME_SESSION_AUTOSTART_DIR", autostart_dirs, TRUE);
}
}
gsm_util_export_activation_environment (NULL);
session_name = opt_session_name;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment