[gnome-control-center] Check gtk_builder_add_from_resource() return value



commit ef4576b4f4ed2b5af67519b2012cabe7af81619d
Author: Rui Matos <tiagomatos gmail com>
Date:   Sun Feb 17 00:44:14 2013 +0100

    Check gtk_builder_add_from_resource() return value

 panels/common/cc-language-chooser.c |    3 +--
 panels/region/cc-format-chooser.c   |    3 +--
 panels/region/cc-input-chooser.c    |    3 +--
 panels/region/cc-input-options.c    |    3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/panels/common/cc-language-chooser.c b/panels/common/cc-language-chooser.c
index 59f55f9..28dbbcc 100644
--- a/panels/common/cc-language-chooser.c
+++ b/panels/common/cc-language-chooser.c
@@ -410,8 +410,7 @@ cc_language_chooser_new (GtkWidget *parent)
         g_resources_register (cc_common_get_resource ());
 
         builder = gtk_builder_new ();
-        gtk_builder_add_from_resource (builder, "/org/gnome/control-center/common/language-chooser.ui", 
&error);
-        if (error) {
+        if (gtk_builder_add_from_resource (builder, "/org/gnome/control-center/common/language-chooser.ui", 
&error) == 0) {
                 g_object_unref (builder);
                 g_warning ("failed to load language chooser: %s", error->message);
                 g_error_free (error);
diff --git a/panels/region/cc-format-chooser.c b/panels/region/cc-format-chooser.c
index e09cf23..a52bf0f 100644
--- a/panels/region/cc-format-chooser.c
+++ b/panels/region/cc-format-chooser.c
@@ -498,8 +498,7 @@ cc_format_chooser_new (GtkWidget *parent)
         GError *error = NULL;
 
         builder = gtk_builder_new ();
-        gtk_builder_add_from_resource (builder, "/org/gnome/control-center/region/format-chooser.ui", 
&error);
-        if (error) {
+        if (gtk_builder_add_from_resource (builder, "/org/gnome/control-center/region/format-chooser.ui", 
&error) == 0) {
                 g_object_unref (builder);
                 g_warning ("failed to load format chooser: %s", error->message);
                 g_error_free (error);
diff --git a/panels/region/cc-input-chooser.c b/panels/region/cc-input-chooser.c
index 20000df..70af7a4 100644
--- a/panels/region/cc-input-chooser.c
+++ b/panels/region/cc-input-chooser.c
@@ -1043,8 +1043,7 @@ cc_input_chooser_new (GtkWindow    *main_window,
   GError *error = NULL;
 
   builder = gtk_builder_new ();
-  gtk_builder_add_from_resource (builder, "/org/gnome/control-center/region/input-chooser.ui", &error);
-  if (error)
+  if (gtk_builder_add_from_resource (builder, "/org/gnome/control-center/region/input-chooser.ui", &error) 
== 0)
     {
       g_object_unref (builder);
       g_warning ("failed to load input chooser: %s", error->message);
diff --git a/panels/region/cc-input-options.c b/panels/region/cc-input-options.c
index b09d968..52ed6f8 100644
--- a/panels/region/cc-input-options.c
+++ b/panels/region/cc-input-options.c
@@ -162,8 +162,7 @@ cc_input_options_new (GtkWidget *parent)
         GError *error = NULL;
 
         builder = gtk_builder_new ();
-        gtk_builder_add_from_resource (builder, "/org/gnome/control-center/region/input-options.ui", &error);
-        if (error) {
+        if (gtk_builder_add_from_resource (builder, "/org/gnome/control-center/region/input-options.ui", 
&error) == 0) {
                 g_object_unref (builder);
                 g_warning ("failed to load input options: %s", error->message);
                 g_error_free (error);


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