[frogr] Allow reversing pictures when sorting as loaded



commit 99ad7911ea4ec3647c4d35847d051a52e2a1e21e
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Mon Apr 25 22:22:46 2011 -0700

    Allow reversing pictures when sorting as loaded

 src/frogr-main-view-model.c |   11 ++++++++---
 src/frogr-main-view.c       |    7 ++-----
 2 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/src/frogr-main-view-model.c b/src/frogr-main-view-model.c
index 4ed9d23..6934b99 100644
--- a/src/frogr-main-view-model.c
+++ b/src/frogr-main-view-model.c
@@ -309,9 +309,14 @@ frogr_main_view_model_reorder_pictures (FrogrMainViewModel *self,
     priv->pictures_list = g_slist_reverse (priv->pictures_list);
 
   priv->pictures_list_reversed = reversed;
-  priv->pictures_list = g_slist_sort_with_data (priv->pictures_list,
-                                                (GCompareDataFunc) _compare_pictures_by_property,
-                                                (gchar*) property_name);
+
+  if (property_name)
+    {
+      /* Only sort if we have specified a property name */
+      priv->pictures_list = g_slist_sort_with_data (priv->pictures_list,
+                                                    (GCompareDataFunc) _compare_pictures_by_property,
+                                                    (gchar*) property_name);
+    }
 
   /* If we're reordering in reverse order, reverse the result list */
   if (reversed)
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index 51a6234..682b7a7 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -1315,11 +1315,8 @@ _reorder_pictures (FrogrMainView *self, SortingCriteria criteria, gboolean rever
       g_assert_not_reached ();
     }
 
-  if (property_name)
-    {
-      frogr_main_view_model_reorder_pictures (priv->model, property_name, reversed);
-      g_free (property_name);
-    }
+  frogr_main_view_model_reorder_pictures (priv->model, property_name, reversed);
+  g_free (property_name);
 }
 
 static void



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