[empathy] Don't enclose trivial blocks in {}.



commit 3f4a0ae03c0eee55bf84f413214f5c834308011b
Author: Travis Reitter <treitter gmail com>
Date:   Fri Jul 9 14:25:14 2010 -0700

    Don't enclose trivial blocks in {}.

 libempathy-gtk/empathy-individual-store.c |   44 ++++-----------
 libempathy-gtk/empathy-individual-view.c  |   85 ++++++++---------------------
 2 files changed, 33 insertions(+), 96 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index b8100ec..5d7dff9 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -148,9 +148,7 @@ individual_store_get_group_foreach (GtkTreeModel *model,
 
   /* Groups are only at the top level. */
   if (gtk_tree_path_get_depth (path) != 1)
-    {
-      return FALSE;
-    }
+    return FALSE;
 
   gtk_tree_model_get (model, iter,
       EMPATHY_INDIVIDUAL_STORE_COL_NAME, &str,
@@ -194,9 +192,7 @@ individual_store_get_group (EmpathyIndividualStore *self,
   if (!fg.found)
     {
       if (created)
-        {
-          *created = TRUE;
-        }
+        *created = TRUE;
 
       gtk_tree_store_insert_with_values (GTK_TREE_STORE (self), &iter_group,
           NULL, 0,
@@ -209,9 +205,7 @@ individual_store_get_group (EmpathyIndividualStore *self,
           -1);
 
       if (iter_group_to_set)
-        {
-          *iter_group_to_set = iter_group;
-        }
+        *iter_group_to_set = iter_group;
 
       gtk_tree_store_insert_with_values (GTK_TREE_STORE (self), &iter_separator,
           &iter_group, 0,
@@ -219,21 +213,15 @@ individual_store_get_group (EmpathyIndividualStore *self,
           -1);
 
       if (iter_separator_to_set)
-        {
-          *iter_separator_to_set = iter_separator;
-        }
+        *iter_separator_to_set = iter_separator;
     }
   else
     {
       if (created)
-        {
-          *created = FALSE;
-        }
+        *created = FALSE;
 
       if (iter_group_to_set)
-        {
-          *iter_group_to_set = fg.iter;
-        }
+        *iter_group_to_set = fg.iter;
 
       iter_separator = fg.iter;
 
@@ -245,9 +233,7 @@ individual_store_get_group (EmpathyIndividualStore *self,
               EMPATHY_INDIVIDUAL_STORE_COL_IS_SEPARATOR, &is_separator, -1);
 
           if (is_separator && iter_separator_to_set)
-            {
-              *iter_separator_to_set = iter_separator;
-            }
+            *iter_separator_to_set = iter_separator;
         }
     }
 }
@@ -294,9 +280,7 @@ individual_store_find_contact (EmpathyIndividualStore *self,
       (GtkTreeModelForeachFunc) individual_store_find_contact_foreach, &fc);
 
   if (fc.found)
-    {
-      l = fc.iters;
-    }
+    l = fc.iters;
 
   return l;
 }
@@ -313,9 +297,7 @@ individual_store_remove_individual (EmpathyIndividualStore *self,
 
   iters = individual_store_find_contact (self, individual);
   if (iters == NULL)
-    {
-      return;
-    }
+    return;
 
   /* Clean up model */
   model = GTK_TREE_MODEL (self);
@@ -360,9 +342,7 @@ individual_store_add_individual (EmpathyIndividualStore *self,
 
   if (EMP_STR_EMPTY (folks_individual_get_alias (individual)) ||
       (!priv->show_offline && !folks_individual_is_online (individual)))
-    {
-      return;
-    }
+    return;
 
   if (priv->show_groups)
     {
@@ -387,9 +367,7 @@ individual_store_add_individual (EmpathyIndividualStore *self,
           "groups' is off is unimplemented");
 
       if (!priv->show_groups)
-        {
-          parent = NULL;
-        }
+        parent = NULL;
       else
         {
           individual_store_get_group (self,
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index b2dc22a..3f8d1dd 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -268,22 +268,17 @@ individual_view_query_tooltip_cb (EmpathyIndividualView *view,
 
   /* Avoid an infinite loop. See GNOME bug #574377 */
   if (running > 0)
-    {
-      return FALSE;
-    }
+    return FALSE;
+
   running++;
 
   /* Don't show the tooltip if there's already a popup menu */
   if (gtk_menu_get_for_attach_widget (GTK_WIDGET (view)) != NULL)
-    {
-      goto OUT;
-    }
+    goto OUT;
 
   if (!gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (view), &x, &y,
           keyboard_mode, &model, &path, &iter))
-    {
-      goto OUT;
-    }
+    goto OUT;
 
   gtk_tree_view_set_tooltip_row (GTK_TREE_VIEW (view), tooltip, path);
   gtk_tree_path_free (path);
@@ -292,9 +287,7 @@ individual_view_query_tooltip_cb (EmpathyIndividualView *view,
       EMPATHY_INDIVIDUAL_STORE_COL_INDIVIDUAL, &individual,
       -1);
   if (individual == NULL)
-    {
-      goto OUT;
-    }
+    goto OUT;
 
   contact = empathy_contact_dup_from_folks_individual (individual);
   g_object_unref (individual);
@@ -314,9 +307,7 @@ individual_view_query_tooltip_cb (EmpathyIndividualView *view,
       gtk_widget_show (priv->tooltip_widget);
     }
   else
-    {
-      empathy_contact_widget_set_contact (priv->tooltip_widget, contact);
-    }
+    empathy_contact_widget_set_contact (priv->tooltip_widget, contact);
 
   gtk_tooltip_set_custom (tooltip, priv->tooltip_widget);
   ret = TRUE;
@@ -480,9 +471,7 @@ individual_view_file_drag_received (GtkWidget *view,
   gtk_tree_model_get (model, &iter,
       EMPATHY_INDIVIDUAL_STORE_COL_INDIVIDUAL, &individual, -1);
   if (individual == NULL)
-    {
-      return FALSE;
-    }
+    return FALSE;
 
   contact = empathy_contact_dup_from_folks_individual (individual);
   empathy_send_file_from_uri_list (contact, sel_data);
@@ -576,9 +565,7 @@ individual_view_drag_motion (GtkWidget *widget,
               && gtk_tree_path_compare (dm->path, path) != 0));
     }
   else
-    {
-      cleanup &= FALSE;
-    }
+    cleanup &= FALSE;
 
   if (path == NULL)
     {
@@ -661,9 +648,7 @@ individual_view_drag_motion (GtkWidget *widget,
     }
 
   if (!is_different && !cleanup)
-    {
-      return retval;
-    }
+    return retval;
 
   if (dm)
     {
@@ -709,9 +694,7 @@ individual_view_drag_begin (GtkWidget *widget,
 
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
   if (!gtk_tree_selection_get_selected (selection, &model, &iter))
-    {
-      return;
-    }
+    return;
 
   path = gtk_tree_model_get_path (model, &iter);
   priv->drag_row = gtk_tree_row_reference_new (model, path);
@@ -736,15 +719,11 @@ individual_view_drag_data_get (GtkWidget *widget,
 
   model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
   if (priv->drag_row == NULL)
-    {
-      return;
-    }
+    return;
 
   src_path = gtk_tree_row_reference_get_path (priv->drag_row);
   if (src_path == NULL)
-    {
-      return;
-    }
+    return;
 
   if (!gtk_tree_model_get_iter (model, &iter, src_path))
     {
@@ -757,9 +736,7 @@ individual_view_drag_data_get (GtkWidget *widget,
   individual =
       empathy_individual_view_dup_selected (EMPATHY_INDIVIDUAL_VIEW (widget));
   if (individual == NULL)
-    {
-      return;
-    }
+    return;
 
   individual_id = folks_individual_get_id (individual);
 
@@ -886,9 +863,7 @@ individual_view_row_activated (GtkTreeView *view,
   GtkTreeIter iter;
 
   if (!(priv->individual_features & EMPATHY_CONTACT_FEATURE_CHAT))
-    {
-      return;
-    }
+    return;
 
   model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
   gtk_tree_model_get_iter (model, &iter, path);
@@ -986,9 +961,7 @@ individual_view_cell_set_background (EmpathyIndividualView *view,
       g_object_set (cell, "cell-background-gdk", &color, NULL);
     }
   else
-    {
-      g_object_set (cell, "cell-background-gdk", NULL, NULL);
-    }
+    g_object_set (cell, "cell-background-gdk", NULL, NULL);
 }
 
 static void
@@ -1159,9 +1132,7 @@ individual_view_expander_cell_data_func (GtkTreeViewColumn *column,
           NULL);
     }
   else
-    {
-      g_object_set (cell, "visible", FALSE, NULL);
-    }
+    g_object_set (cell, "visible", FALSE, NULL);
 
   individual_view_cell_set_background (view, cell, is_group, is_active);
 }
@@ -1858,9 +1829,7 @@ empathy_individual_view_dup_selected (EmpathyIndividualView *view)
 
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
   if (!gtk_tree_selection_get_selected (selection, &model, &iter))
-    {
-      return NULL;
-    }
+    return NULL;
 
   gtk_tree_model_get (model, &iter,
       EMPATHY_INDIVIDUAL_STORE_COL_INDIVIDUAL, &individual, -1);
@@ -1883,9 +1852,7 @@ empathy_individual_view_get_flags (EmpathyIndividualView *view)
 
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
   if (!gtk_tree_selection_get_selected (selection, &model, &iter))
-    {
-      return 0;
-    }
+    return 0;
 
   gtk_tree_model_get (model, &iter,
       EMPATHY_INDIVIDUAL_STORE_COL_FLAGS, &flags, -1);
@@ -1911,9 +1878,7 @@ empathy_individual_view_get_selected_group (EmpathyIndividualView *view,
 
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
   if (!gtk_tree_selection_get_selected (selection, &model, &iter))
-    {
-      return NULL;
-    }
+    return NULL;
 
   gtk_tree_model_get (model, &iter,
       EMPATHY_INDIVIDUAL_STORE_COL_IS_GROUP, &is_group,
@@ -2001,9 +1966,7 @@ empathy_individual_view_get_group_menu (EmpathyIndividualView *view)
 
   if (!(priv->view_features & (EMPATHY_INDIVIDUAL_VIEW_FEATURE_GROUPS_RENAME |
               EMPATHY_INDIVIDUAL_VIEW_FEATURE_GROUPS_REMOVE)))
-    {
-      return NULL;
-    }
+    return NULL;
 
   group = empathy_individual_view_get_selected_group (view, &is_fake_group);
   if (!group || is_fake_group)
@@ -2090,9 +2053,7 @@ empathy_individual_view_get_individual_menu (EmpathyIndividualView *view)
 
   individual = empathy_individual_view_dup_selected (view);
   if (individual == NULL)
-    {
-      return NULL;
-    }
+    return NULL;
 
   flags = empathy_individual_view_get_flags (view);
 
@@ -2106,9 +2067,7 @@ empathy_individual_view_get_individual_menu (EmpathyIndividualView *view)
 
       /* create the menu if required, or just add a separator */
       if (menu == NULL)
-        {
-          menu = gtk_menu_new ();
-        }
+        menu = gtk_menu_new ();
       else
         {
           item = gtk_separator_menu_item_new ();



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