aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution/e-summary-tasks.c
diff options
context:
space:
mode:
Diffstat (limited to 'my-evolution/e-summary-tasks.c')
-rw-r--r--my-evolution/e-summary-tasks.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/my-evolution/e-summary-tasks.c b/my-evolution/e-summary-tasks.c
index 4a96e565cb..a8c32b1db7 100644
--- a/my-evolution/e-summary-tasks.c
+++ b/my-evolution/e-summary-tasks.c
@@ -136,9 +136,8 @@ sort_uids (gconstpointer a,
CalComponent *comp_a, *comp_b;
CalClient *client = user_data;
CalClientGetStatus status;
- /* let undefined priorities be lowest ones */
- int lowest = 10, rv;
- int *pri_a, *pri_b;
+ CalComponentDateTime start_a, start_b;
+ int retval;
/* a after b then return > 0 */
@@ -150,22 +149,20 @@ sort_uids (gconstpointer a,
if (status != CAL_CLIENT_GET_SUCCESS)
return 1;
- cal_component_get_priority (comp_a, &pri_a);
- cal_component_get_priority (comp_b, &pri_b);
+ cal_component_get_dtstart (comp_a, &start_a);
+ cal_component_get_dtstart (comp_b, &start_b);
- if (pri_a == NULL)
- pri_a = &lowest;
- if (pri_b == NULL)
- pri_b = &lowest;
-
- rv = *pri_a - *pri_b;
+ if (start_a.value == NULL || start_b.value == NULL) {
+ /* Try to do something reasonable if one or more of our .values is NULL */
+ retval = (start_a.value ? 1 : 0) - (start_b.value ? 1 : 0);
+ } else {
+ retval = icaltime_compare (*start_a.value, *start_b.value);
+ }
- if (pri_a != &lowest)
- cal_component_free_priority (pri_a);
- if (pri_b != &lowest)
- cal_component_free_priority (pri_b);
+ cal_component_free_datetime (&start_a);
+ cal_component_free_datetime (&start_b);
- return rv;
+ return retval;
}
static GList *
@@ -256,12 +253,11 @@ generate_html (gpointer data)
g_free (s1);
g_free (s2);
-/* e_summary_draw (summary); */
+ e_summary_draw (summary);
return FALSE;
} else {
char *s;
- uids = cal_list_sort (uids, sort_uids, tasks->client);
string = g_string_new ("<dl><dt><img src=\"myevo-post-it.png\" align=\"middle\" "
"alt=\"\" width=\"48\" height=\"48\"> <b><a href=\"evolution:/local/Tasks\">");
s = e_utf8_from_locale_string (_("Tasks"));
@@ -316,7 +312,7 @@ generate_html (gpointer data)
tasks->html = string->str;
g_string_free (string, FALSE);
-/* e_summary_draw (summary); */
+ e_summary_draw (summary);
return FALSE;
}