[easytag/wip/musicbrainz-support-appwin-merge: 31/49] Use g_return_if_fail for checking GtkTreeModelFitler



commit 69d2f0967ba4be0acee6d93b1053d90f036144a9
Author: Abhinav <abhijangda hotmail com>
Date:   Tue Aug 12 16:43:32 2014 +0530

    Use g_return_if_fail for checking GtkTreeModelFitler

 src/mbentityview.c |   37 ++++++-------------------------------
 1 files changed, 6 insertions(+), 31 deletions(-)
---
diff --git a/src/mbentityview.c b/src/mbentityview.c
index 11010d7..7d7e00d 100644
--- a/src/mbentityview.c
+++ b/src/mbentityview.c
@@ -1099,12 +1099,7 @@ et_mb_entity_view_toggle_red_lines (EtMbEntityView *entity_view)
     priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
     priv->search_or_red = priv->search_or_red | ET_MB_DISPLAY_RESULTS_RED;
     priv->toggle_red_lines = !priv->toggle_red_lines;
-
-    if (!priv->filter)
-    {
-        return;
-    }
-
+    g_return_if_fail (!priv->filter);
     gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (priv->filter));
 }
 
@@ -1122,12 +1117,7 @@ et_mb_entity_view_invert_selection (EtMbEntityView *entity_view)
     GtkTreeSelection *selection;
 
     priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
-
-    if (!priv->filter)
-    {
-        return;
-    }
-
+    g_return_if_fail (!priv->filter);
     selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree_view));
 
     if (!gtk_tree_model_get_iter_first (priv->filter, &filter_iter))
@@ -1185,12 +1175,7 @@ et_mb_entity_view_search_in_results (EtMbEntityView *entity_view,
     priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
     priv->text_to_search_in_results = text;
     priv->search_or_red = priv->search_or_red | ET_MB_DISPLAY_RESULTS_SEARCH;
-
-    if (!priv->filter)
-    {
-        return;
-    }
-
+    g_return_if_fail (!priv->filter);
     gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (priv->filter));
 }
 
@@ -1209,12 +1194,7 @@ et_mb_entity_view_select_up (EtMbEntityView *entity_view)
     GList *selected_rows;
 
     priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
-
-    if (!priv->filter)
-    {
-        return;
-    }
-
+    g_return_if_fail (!priv->filter);
     selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree_view));
     selected_rows = gtk_tree_selection_get_selected_rows (selection,
                                                           &priv->filter);
@@ -1250,13 +1230,8 @@ et_mb_entity_view_select_down (EtMbEntityView *entity_view)
     GtkTreeIter iter;
     GList *selected_rows;
 
-    priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
-    
-    if (!priv->filter)
-    {
-        return;
-    }
-
+    priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);   
+    g_return_if_fail (!priv->filter);
     selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree_view));
     selected_rows = gtk_tree_selection_get_selected_rows (selection,
                                                           &priv->filter);


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