[easytag/wip/musicbrainz-support-appwin-merge: 27/49] Use NULL pointer check instead of GTK_IS_TYPE



commit 68d66a1b7ec81dddf11a71bb5ce4e0b599faaeb7
Author: Abhinav <abhijangda hotmail com>
Date:   Tue Aug 12 15:42:17 2014 +0530

    Use NULL pointer check instead of GTK_IS_TYPE

 src/mbentityview.c |   26 +++++++++-----------------
 1 files changed, 9 insertions(+), 17 deletions(-)
---
diff --git a/src/mbentityview.c b/src/mbentityview.c
index 0eae27c..05e11eb 100644
--- a/src/mbentityview.c
+++ b/src/mbentityview.c
@@ -502,23 +502,15 @@ show_data_in_entity_view (EtMbEntityView *entity_view)
     };
 
     priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
-
-    /* Remove the previous List Store */
-    if (GTK_IS_LIST_STORE (priv->list_store))
-    {
-        gtk_list_store_clear (GTK_LIST_STORE (priv->list_store));
-        g_object_unref (priv->list_store);
-    }
-
     gtk_tree_view_set_model (GTK_TREE_VIEW (priv->tree_view), NULL);
+    priv->filter = NULL;
 
-    if (GTK_IS_TREE_MODEL_FILTER (priv->filter))
-    {
-        g_object_unref (priv->filter);
-    }
+    /* Remove the previous List Store */
+    g_clear_object (&priv->list_store);
 
     /* Remove all colums */
     list_cols = gtk_tree_view_get_columns (GTK_TREE_VIEW (priv->tree_view));
+
     for (list = g_list_first (list_cols); list != NULL;
          list = g_list_next (list))
     {
@@ -1104,7 +1096,7 @@ et_mb_entity_view_toggle_red_lines (EtMbEntityView *entity_view)
     priv->search_or_red = priv->search_or_red | ET_MB_DISPLAY_RESULTS_RED;
     priv->toggle_red_lines = !priv->toggle_red_lines;
 
-    if (!GTK_IS_TREE_MODEL_FILTER (priv->filter))
+    if (!priv->filter)
     {
         return;
     }
@@ -1127,7 +1119,7 @@ et_mb_entity_view_invert_selection (EtMbEntityView *entity_view)
 
     priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
 
-    if (!GTK_IS_TREE_MODEL_FILTER (priv->filter))
+    if (!priv->filter)
     {
         return;
     }
@@ -1190,7 +1182,7 @@ et_mb_entity_view_search_in_results (EtMbEntityView *entity_view,
     priv->text_to_search_in_results = text;
     priv->search_or_red = priv->search_or_red | ET_MB_DISPLAY_RESULTS_SEARCH;
 
-    if (!GTK_IS_TREE_MODEL_FILTER (priv->filter))
+    if (!priv->filter)
     {
         return;
     }
@@ -1214,7 +1206,7 @@ et_mb_entity_view_select_up (EtMbEntityView *entity_view)
 
     priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
 
-    if (!GTK_IS_TREE_MODEL_FILTER (priv->filter))
+    if (!priv->filter)
     {
         return;
     }
@@ -1256,7 +1248,7 @@ et_mb_entity_view_select_down (EtMbEntityView *entity_view)
 
     priv = ET_MB_ENTITY_VIEW_GET_PRIVATE (entity_view);
     
-    if (!GTK_IS_TREE_MODEL_FILTER (priv->filter))
+    if (!priv->filter)
     {
         return;
     }


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