[yelp] yelp-settings: Fix if:env for gnome-panel when running gnome-shell
- From: Shaun McCance <shaunm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [yelp] yelp-settings: Fix if:env for gnome-panel when running gnome-shell
- Date: Thu, 1 Dec 2011 15:13:40 +0000 (UTC)
commit 13c8b66c6fcf0260445435c99f05b7e49382b00f
Author: Shaun McCance <shaunm gnome org>
Date: Thu Dec 1 10:11:57 2011 -0500
yelp-settings: Fix if:env for gnome-panel when running gnome-shell
Turns out that gnome-shell claims org.gnome.Panel, so we were getting
true for if:env('gnome-panel') when you're not running gnome-panel.
libyelp/yelp-settings.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/libyelp/yelp-settings.c b/libyelp/yelp-settings.c
index 8995e60..4d3ec4a 100644
--- a/libyelp/yelp-settings.c
+++ b/libyelp/yelp-settings.c
@@ -248,6 +248,7 @@ yelp_settings_constructed (GObject *object)
GVariant *ret, *names;
GVariantIter iter;
gchar *name;
+ gboolean env_shell, env_panel, env_unity, env_xfce;
GError *error = NULL;
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
@@ -271,20 +272,29 @@ yelp_settings_constructed (GObject *object)
g_error_free (error);
return;
}
+ env_shell = env_panel = env_unity = env_xfce = FALSE;
names = g_variant_get_child_value (ret, 0);
g_variant_iter_init (&iter, names);
while (g_variant_iter_loop (&iter, "&s", &name)) {
if (g_str_equal (name, "org.gnome.Panel"))
- yelp_settings_set_env (settings, "gnome-panel");
+ env_panel = TRUE;
else if (g_str_equal (name, "org.gnome.Shell"))
- yelp_settings_set_env (settings, "gnome-shell");
+ env_shell = TRUE;
else if (g_str_equal (name, "com.canonical.Unity"))
- yelp_settings_set_env (settings, "unity");
+ env_unity = TRUE;
else if (g_str_equal (name, "org.xfce.Panel"))
- yelp_settings_set_env (settings, "xfce");
+ env_xfce = TRUE;
}
g_variant_unref (names);
g_variant_unref (ret);
+ if (env_shell)
+ yelp_settings_set_env (settings, "gnome-shell");
+ else if (env_xfce)
+ yelp_settings_set_env (settings, "xfce");
+ else if (env_unity)
+ yelp_settings_set_env (settings, "unity");
+ else if (env_panel)
+ yelp_settings_set_env (settings, "gnome-panel");
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]