[gnome-calendar] search-view: ignore case when sorting events



commit 38311c27b59216d5ce275af2348b4b074eb005f6
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Tue Jan 6 17:23:39 2015 -0200

    search-view: ignore case when sorting events

 src/gcal-search-view.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-search-view.c b/src/gcal-search-view.c
index 010cb26..748dde9 100644
--- a/src/gcal-search-view.c
+++ b/src/gcal-search-view.c
@@ -237,6 +237,7 @@ sort_by_event (GtkListBoxRow *row1,
   GcalEventData *ev1, *ev2;
   ECalComponentText summary1, summary2;
   ECalComponentDateTime date1, date2;
+  gchar *down1, *down2;
   gint result;
 
   priv = gcal_search_view_get_instance_private (GCAL_SEARCH_VIEW (user_data));
@@ -250,9 +251,13 @@ sort_by_event (GtkListBoxRow *row1,
 
   e_cal_component_get_summary (ev1->event_component, &summary1);
   e_cal_component_get_summary (ev2->event_component, &summary2);
+  down1 = g_utf8_strdown (summary1.value, -1);
+  down2 = g_utf8_strdown (summary2.value, -1);
 
-  /* Second, by their names */
-  result = g_strcmp0 (summary1.value, summary2.value);
+  /* First, by their names */
+  result = g_strcmp0 (down1, down2);
+  g_free (down1);
+  g_free (down2);
 
   if (result != 0)
     return result;
@@ -260,7 +265,7 @@ sort_by_event (GtkListBoxRow *row1,
   e_cal_component_get_dtstart (ev1->event_component, &date1);
   e_cal_component_get_dtstart (ev2->event_component, &date2);
 
-  /* First, compare by their dates */
+  /* Second, compare by their dates */
   result = icaltime_compare (*date1.value, *date2.value);
   e_cal_component_free_datetime (&date1);
   e_cal_component_free_datetime (&date2);


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