[gnome-calendar/search-improvements] search-view: order by date, instead of name
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/search-improvements] search-view: order by date, instead of name
- Date: Thu, 8 Jan 2015 15:11:46 +0000 (UTC)
commit ee3a55d41b98bfc7edc8a220968b922b7e86ad4e
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Jan 8 13:11:38 2015 -0200
search-view: order by date, instead of name
src/gcal-search-view.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/src/gcal-search-view.c b/src/gcal-search-view.c
index 8b879bd..2232808 100644
--- a/src/gcal-search-view.c
+++ b/src/gcal-search-view.c
@@ -242,6 +242,17 @@ sort_by_event (GtkListBoxRow *row1,
if (ev1 == NULL || ev2 == NULL)
return 0;
+ e_cal_component_get_dtstart (ev1->event_component, &date1);
+ e_cal_component_get_dtstart (ev2->event_component, &date2);
+
+ /* Second, compare by their dates */
+ result = icaltime_compare (*date1.value, *date2.value);
+ e_cal_component_free_datetime (&date1);
+ e_cal_component_free_datetime (&date2);
+
+ if (result != 0)
+ return -1 * result;
+
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);
@@ -252,18 +263,7 @@ sort_by_event (GtkListBoxRow *row1,
g_free (down1);
g_free (down2);
- if (result != 0)
- return result;
-
- e_cal_component_get_dtstart (ev1->event_component, &date1);
- e_cal_component_get_dtstart (ev2->event_component, &date2);
-
- /* Second, compare by their dates */
- result = icaltime_compare (*date1.value, *date2.value);
- e_cal_component_free_datetime (&date1);
- e_cal_component_free_datetime (&date2);
-
- return -1 * result;
+ return result;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]