[gnome-control-center] Printers: Check that GValue holds int before using it



commit 60e9f496733ad67ac9a1f6885d0e834dd1c224f5
Author: Marek Kasik <mkasik redhat com>
Date:   Mon May 16 10:43:18 2011 +0200

    Printers: Check that GValue holds int before using it
    
    Check that GValue returned as value of GTK_STYLE_PROPERTY_BORDER_RADIUS
    holds int.

 panels/printers/cc-printers-panel.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index af2f17d..9921fe0 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -1736,14 +1736,15 @@ supply_levels_draw_cb (GtkWidget *widget,
           gchar   **marker_namesv = NULL;
           gchar   **marker_typesv = NULL;
           gchar    *tmp = NULL;
-          gint      border_radius = 3;
+          gint      border_radius = 0;
 
           context = gtk_widget_get_style_context ((GtkWidget *)
             gtk_builder_get_object (priv->builder, "printer-options-button"));
           gtk_style_context_get_border_color (context, 0, &border_color);
           gtk_style_context_get_property (
             context, GTK_STYLE_PROPERTY_BORDER_RADIUS, 0, &int_val);
-          border_radius = g_value_get_int (&int_val);
+          if (G_VALUE_HOLDS_INT (&int_val))
+            border_radius = g_value_get_int (&int_val);
 
           widget = (GtkWidget*)
             gtk_builder_get_object (priv->builder, "supply-drawing-area");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]