[gnome-control-center] info: make sure to always print an experience value
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] info: make sure to always print an experience value
- Date: Tue, 15 Feb 2011 19:16:02 +0000 (UTC)
commit 17008fe56556579b24d7b2d52dc3a536cb8c8e4d
Author: William Jon McCann <jmccann redhat com>
Date: Tue Feb 15 13:59:27 2011 -0500
info: make sure to always print an experience value
panels/info/cc-info-panel.c | 29 +++++++++++++++++++++--------
1 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/panels/info/cc-info-panel.c b/panels/info/cc-info-panel.c
index 10f39db..095c2ab 100644
--- a/panels/info/cc-info-panel.c
+++ b/panels/info/cc-info-panel.c
@@ -371,14 +371,15 @@ get_is_graphics_accelerated (void)
}
-static char *
-get_graphics_experience (CcInfoPanel *self)
+static gboolean
+get_current_is_fallback (CcInfoPanel *self)
{
- GError *error = NULL;
- GVariant *reply, *reply_bool;
- gboolean is_fallback;
- gchar *experience_str;
+ GError *error;
+ GVariant *reply;
+ GVariant *reply_bool;
+ gboolean is_fallback;
+ error = NULL;
if (!(reply = g_dbus_connection_call_sync (self->priv->session_bus,
"org.gnome.SessionManager",
"/org/gnome/SessionManager",
@@ -392,15 +393,27 @@ get_graphics_experience (CcInfoPanel *self)
{
g_warning ("Failed to get fallback mode: %s", error->message);
g_clear_error (&error);
- return NULL;
+ return FALSE;
}
g_variant_get (reply, "(v)", &reply_bool);
is_fallback = g_variant_get_boolean (reply_bool);
- experience_str = g_strdup (is_fallback ? _("Fallback") : _("Default"));
g_variant_unref (reply_bool);
g_variant_unref (reply);
+ return is_fallback;
+}
+
+static char *
+get_graphics_experience (CcInfoPanel *self)
+{
+ char *experience_str;
+
+ if (get_current_is_fallback (self))
+ experience_str = g_strdup (_("Fallback"));
+ else
+ experience_str = g_strdup (_("Standard"));
+
return experience_str;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]