[gnome-session] autostart: Stop messing with XDG_CURRENT_DESKTOP
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-session] autostart: Stop messing with XDG_CURRENT_DESKTOP
- Date: Wed, 7 May 2014 07:10:08 +0000 (UTC)
commit 35044a5cbc3b066b1dcee27a28ab576241e16dcf
Author: Florian Müllner <fmuellner gnome org>
Date: Tue May 6 16:22:07 2014 +0200
autostart: Stop messing with XDG_CURRENT_DESKTOP
The use of the XDG_CURRENT_DESKTOP variable predates the actual
standardization that only happened recently, and indeed does not
work when the variable contains a colon-separated list as allowed
by the new standard. Stop using it altogether, so GIO can handle it
for us (which it will soon).
https://bugzilla.gnome.org/show_bug.cgi?id=729575
gnome-session/gsm-autostart-app.c | 11 +++--------
gnome-session/gsm-util.c | 27 ---------------------------
gnome-session/gsm-util.h | 2 --
3 files changed, 3 insertions(+), 37 deletions(-)
---
diff --git a/gnome-session/gsm-autostart-app.c b/gnome-session/gsm-autostart-app.c
index 14df013..6d7335f 100644
--- a/gnome-session/gsm-autostart-app.c
+++ b/gnome-session/gsm-autostart-app.c
@@ -114,7 +114,6 @@ static gboolean
is_disabled (GsmApp *app)
{
GsmAutostartAppPrivate *priv;
- const char *current_desktop;
priv = GSM_AUTOSTART_APP (app)->priv;
@@ -136,13 +135,9 @@ is_disabled (GsmApp *app)
}
/* Check OnlyShowIn/NotShowIn/TryExec */
- current_desktop = gsm_util_get_current_desktop ();
- g_desktop_app_info_set_desktop_env (current_desktop);
- if (current_desktop != NULL &&
- !g_desktop_app_info_get_show_in (G_DESKTOP_APP_INFO (priv->app_info),
- current_desktop)) {
- g_debug ("app %s not for %s",
- gsm_app_peek_id (app), current_desktop);
+ if (!g_app_info_should_show (G_DESKTOP_APP_INFO (priv->app_info))) {
+ g_debug ("app %s is not for the current desktop",
+ gsm_app_peek_id (app));
return TRUE;
}
diff --git a/gnome-session/gsm-util.c b/gnome-session/gsm-util.c
index 4ac55cf..ff6484c 100644
--- a/gnome-session/gsm-util.c
+++ b/gnome-session/gsm-util.c
@@ -325,33 +325,6 @@ gsm_util_get_desktop_dirs (gboolean include_saved_session,
return result;
}
-const char *
-gsm_util_get_current_desktop ()
-{
- static char *current_desktop = NULL;
-
- /* Support XDG_CURRENT_DESKTOP environment variable; this can be used
- * to abuse gnome-session in non-GNOME desktops. */
- if (!current_desktop) {
- const char *desktop;
-
- desktop = g_getenv ("XDG_CURRENT_DESKTOP");
-
- /* Note: if XDG_CURRENT_DESKTOP is set but empty, do as if it
- * was not set */
- if (!desktop || desktop[0] == '\0')
- current_desktop = g_strdup ("GNOME");
- else
- current_desktop = g_strdup (desktop);
- }
-
- /* Using "*" means skipping desktop-related checks */
- if (g_strcmp0 (current_desktop, "*") == 0)
- return NULL;
-
- return current_desktop;
-}
-
gboolean
gsm_util_text_is_blank (const char *str)
{
diff --git a/gnome-session/gsm-util.h b/gnome-session/gsm-util.h
index 98d3d7a..2ce9f9d 100644
--- a/gnome-session/gsm-util.h
+++ b/gnome-session/gsm-util.h
@@ -40,8 +40,6 @@ void gsm_util_set_autostart_dirs (char **dirs);
gchar ** gsm_util_get_desktop_dirs (gboolean include_saved_session,
gboolean autostart_first);
-const char *gsm_util_get_current_desktop (void);
-
gboolean gsm_util_text_is_blank (const char *str);
void gsm_util_init_error (gboolean fatal,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]