[gnome-control-center] Fix code style issues



commit 12ce8a7fd95eb8bcfd80cf55a704e29c7488ac5d
Author: Rui Matos <tiagomatos gmail com>
Date:   Sun Feb 17 00:41:08 2013 +0100

    Fix code style issues

 panels/common/cc-language-chooser.c |   21 ++++++++++-----------
 panels/region/cc-format-chooser.c   |   21 ++++++++++-----------
 panels/region/cc-input-chooser.c    |   12 ++++++------
 panels/region/cc-input-options.c    |    3 +--
 4 files changed, 27 insertions(+), 30 deletions(-)
---
diff --git a/panels/common/cc-language-chooser.c b/panels/common/cc-language-chooser.c
index 8ffdec3..158f0ea 100644
--- a/panels/common/cc-language-chooser.c
+++ b/panels/common/cc-language-chooser.c
@@ -96,12 +96,10 @@ sort_languages (gconstpointer a,
         const gchar *la;
         const gchar *lb;
 
-        if (g_object_get_data (G_OBJECT (a), "locale-id") == NULL) {
+        if (g_object_get_data (G_OBJECT (a), "locale-id") == NULL)
                 return 1;
-        }
-        if (g_object_get_data (G_OBJECT (b), "locale-id") == NULL) {
+        if (g_object_get_data (G_OBJECT (b), "locale-id") == NULL)
                 return -1;
-        }
 
         la = g_object_get_data (G_OBJECT (a), "locale-name");
         lb = g_object_get_data (G_OBJECT (b), "locale-name");
@@ -145,9 +143,8 @@ language_widget_new (const gchar *locale_id,
         check = gtk_image_new ();
         g_object_set (check, "icon-size", GTK_ICON_SIZE_MENU, NULL);
         gtk_box_pack_start (GTK_BOX (widget), check, FALSE, FALSE, 0);
-        if (g_strcmp0 (locale_id, current_locale_id) == 0) {
+        if (g_strcmp0 (locale_id, current_locale_id) == 0)
                 gtk_image_set_from_icon_name (GTK_IMAGE (check), "object-select-symbolic", 
GTK_ICON_SIZE_MENU);
-        }
 
         g_object_set_data (G_OBJECT (widget), "check", check);
         g_object_set_data_full (G_OBJECT (widget), "locale-id", g_strdup (locale_id), g_free);
@@ -346,14 +343,16 @@ child_activated (EggListBox        *box,
 
         if (child == NULL)
                 return;
-        else if (child == priv->no_results)
+
+        if (child == priv->no_results)
                 return;
-        else if (child == priv->more_item)
+
+        if (child == priv->more_item) {
                 show_more (chooser);
-        else {
-                new_locale_id = g_object_get_data (G_OBJECT (child), "locale-id");
-                set_locale_id (chooser, new_locale_id);
+                return;
         }
+        new_locale_id = g_object_get_data (G_OBJECT (child), "locale-id");
+        set_locale_id (chooser, new_locale_id);
 }
 
 typedef struct {
diff --git a/panels/region/cc-format-chooser.c b/panels/region/cc-format-chooser.c
index 640babc..2f96ee4 100644
--- a/panels/region/cc-format-chooser.c
+++ b/panels/region/cc-format-chooser.c
@@ -106,9 +106,8 @@ update_format_examples (GtkDialog *chooser)
         setlocale (LC_MONETARY, priv->region);
 
         num_info = localeconv ();
-        if (num_info != NULL) {
+        if (num_info != NULL)
                 gtk_label_set_text (GTK_LABEL (priv->currency), num_info->currency_symbol);
-        }
 
         setlocale (LC_MONETARY, locale);
         g_free (locale);
@@ -191,12 +190,10 @@ sort_regions (gconstpointer a,
         const gchar *la;
         const gchar *lb;
 
-        if (g_object_get_data (G_OBJECT (a), "locale-id") == NULL) {
+        if (g_object_get_data (G_OBJECT (a), "locale-id") == NULL)
                 return 1;
-        }
-        if (g_object_get_data (G_OBJECT (b), "locale-id") == NULL) {
+        if (g_object_get_data (G_OBJECT (b), "locale-id") == NULL)
                 return -1;
-        }
 
         la = g_object_get_data (G_OBJECT (a), "locale-name");
         lb = g_object_get_data (G_OBJECT (b), "locale-name");
@@ -437,14 +434,16 @@ child_activated (EggListBox  *box,
 
         if (child == NULL)
                 return;
-        else if (child == priv->no_results)
+
+        if (child == priv->no_results)
                 return;
-        else if (child == priv->more_item)
+
+        if (child == priv->more_item) {
                 show_more (chooser);
-        else {
-                new_locale_id = g_object_get_data (G_OBJECT (child), "locale-id");
-                set_locale_id (chooser, new_locale_id);
+                return;
         }
+        new_locale_id = g_object_get_data (G_OBJECT (child), "locale-id");
+        set_locale_id (chooser, new_locale_id);
 }
 
 typedef struct {
diff --git a/panels/region/cc-input-chooser.c b/panels/region/cc-input-chooser.c
index aea2732..20000df 100644
--- a/panels/region/cc-input-chooser.c
+++ b/panels/region/cc-input-chooser.c
@@ -33,7 +33,7 @@
 #ifdef HAVE_IBUS
 #include <ibus.h>
 #include "cc-ibus-utils.h"
-#endif
+#endif  /* HAVE_IBUS */
 
 #define INPUT_SOURCE_TYPE_XKB "xkb"
 #define INPUT_SOURCE_TYPE_IBUS "ibus"
@@ -241,7 +241,7 @@ input_source_widget_new (GtkWidget   *chooser,
                               cc_util_normalize_casefold_and_unaccent (display_name), g_free);
 #else
       widget = NULL;
-#endif
+#endif  /* HAVE_IBUS */
     }
 
   if (widget)
@@ -573,7 +573,7 @@ strvs_differ (gchar **av,
     if (!g_str_equal (*a, *b))
       return TRUE;
 
-  if (!*a && !*b)
+  if (*a == NULL && *b == NULL)
     return FALSE;
 
   return TRUE;
@@ -883,7 +883,7 @@ get_ibus_locale_infos (GtkWidget *chooser)
       g_free (lang_code);
     }
 }
-#endif
+#endif  /* HAVE_IBUS */
 
 static void
 add_locale_to_table (GHashTable  *table,
@@ -1080,7 +1080,7 @@ cc_input_chooser_new (GtkWindow    *main_window,
   get_locale_infos (chooser);
 #ifdef HAVE_IBUS
   get_ibus_locale_infos (chooser);
-#endif
+#endif  /* HAVE_IBUS */
   show_locale_widgets (chooser);
 
   /* Try to come up with a sensible width */
@@ -1107,7 +1107,7 @@ cc_input_chooser_set_ibus_engines (GtkWidget  *chooser,
   priv->ibus_engines = ibus_engines;
   get_ibus_locale_infos (chooser);
   show_locale_widgets (chooser);
-#endif
+#endif  /* HAVE_IBUS */
 }
 
 gboolean
diff --git a/panels/region/cc-input-options.c b/panels/region/cc-input-options.c
index 66d9240..b09d968 100644
--- a/panels/region/cc-input-options.c
+++ b/panels/region/cc-input-options.c
@@ -121,9 +121,8 @@ update_shortcuts (GtkWidget *options)
         next = g_settings_get_strv (settings, "switch-input-source");
 
         previous_shortcut = g_strdup (previous[0]);
-        if (!previous_shortcut && next[0]) {
+        if (!previous_shortcut && next[0])
                 previous_shortcut = g_strconcat ("<Shift>", next[0], NULL);
-        }
 
         update_shortcut_label (priv->previous_source, previous_shortcut);
         update_shortcut_label (priv->next_source, next[0]);


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