[frogr] Warning when using a picture property of unsupported type for sorting



commit bba20c045b434b165efd971f137cfa7998fa4b8b
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Mon Apr 25 12:23:56 2011 -0700

    Warning when using a picture property of unsupported type for sorting

 src/frogr-main-view-model.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/frogr-main-view-model.c b/src/frogr-main-view-model.c
index fcebc5d..bdcbe6e 100644
--- a/src/frogr-main-view-model.c
+++ b/src/frogr-main-view-model.c
@@ -81,10 +81,6 @@ _compare_pictures_by_property_asc (FrogrPicture *p1, FrogrPicture *p2,
   pspec1 = g_object_class_find_property (G_OBJECT_GET_CLASS (p1), property_name);
   pspec2 = g_object_class_find_property (G_OBJECT_GET_CLASS (p2), property_name);
 
-  /* GObjects not supported */
-  if (pspec1->value_type == G_TYPE_OBJECT)
-    return 0;
-
   /* They should be the same! */
   if (pspec1->value_type != pspec2->value_type)
     return 0;
@@ -103,6 +99,8 @@ _compare_pictures_by_property_asc (FrogrPicture *p1, FrogrPicture *p2,
     result = g_value_get_long (&value1) - g_value_get_long (&value2);
   else if (G_VALUE_HOLDS_STRING (&value1))
     result = g_strcmp0 (g_value_get_string (&value1), g_value_get_string (&value2));
+  else
+    g_warning ("Unsupported type for property used for sorting");
 
   g_value_unset (&value1);
   g_value_unset (&value2);



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