[calls/bump-glib: 3/3] util: Get rid of conditional compilation in calls_find_in_store()




commit 1c7ba1d56e0dc7a84fd119a68777e27e829bb5e3
Author: Evangelos Ribeiro Tzaras <evangelos tzaras puri sm>
Date:   Tue Jun 22 07:49:13 2021 +0200

    util: Get rid of conditional compilation in calls_find_in_store()
    
    This is not needed anymore after bumping the required glib version to 2.64.

 src/util.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/util.c b/src/util.c
index e79576d1..002065b2 100644
--- a/src/util.c
+++ b/src/util.c
@@ -180,15 +180,16 @@ calls_find_in_store (GListModel *list,
                      gpointer    item,
                      guint      *position)
 {
-#if GLIB_CHECK_VERSION(2, 64, 0)
-  return g_list_store_find ((GListStore *) list,
-                            item,
-                            position);
-#else
+  GListStore *store = (GListStore *) list;
   guint count;
 
   g_return_val_if_fail (G_IS_LIST_MODEL (list), FALSE);
 
+  if (G_IS_LIST_STORE (store))
+    return g_list_store_find (store,
+                              item,
+                              position);
+
   count = g_list_model_get_n_items (list);
 
   for (guint i = 0; i < count; i++) {
@@ -203,7 +204,6 @@ calls_find_in_store (GListModel *list,
     }
   }
   return FALSE;
-#endif
 }
 
 /**


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