[easytag/wip/musicbrainz-support-merge: 5/9] Use NULL pointer check instead of GTK_IS_TYPE



commit b8a05a849b2e503ddfcb40b9f8047c7672e1021b
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 |   28 ++++++++++------------------
 1 files changed, 10 insertions(+), 18 deletions(-)
---
diff --git a/src/mbentityview.c b/src/mbentityview.c
index 2579aaf..fc4b257 100644
--- a/src/mbentityview.c
+++ b/src/mbentityview.c
@@ -503,23 +503,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))
     {
@@ -1105,7 +1097,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;
     }
@@ -1128,7 +1120,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;
     }
@@ -1191,7 +1183,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;
     }
@@ -1215,7 +1207,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;
     }
@@ -1257,7 +1249,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;
     }
@@ -1443,4 +1435,4 @@ et_mb_entity_view_get_selected_entity_list (EtMbEntityView *entity_view,
 
     return count;
 }
-#endif /* ENABLE_libmusicbrainz */
+#endif /* ENABLE_libmusicbrainz */
\ No newline at end of file


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