[Xfce4-commits] <orage:master> 4.8.3.7 Enhancement 9738 Main window should sort TODOs by due-date
Juha
noreply at xfce.org
Mon Jan 28 14:50:01 CET 2013
Updating branch refs/heads/master
to 436c095d46dbcefd95f99a7e50cf7b155c3e2ac8 (commit)
from 9b157a7511f3007ba188bb576621f95729728c6c (commit)
commit 436c095d46dbcefd95f99a7e50cf7b155c3e2ac8
Author: Juha <juha at xfce.org>
Date: Mon Jan 28 15:47:39 2013 +0200
4.8.3.7 Enhancement 9738 Main window should sort TODOs by due-date
Changed main calendar to sort TODOs based on due-date (those without due
date come last).
configure.in.in | 2 +-
src/mainbox.c | 28 ++++++++++++++++++++++++----
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/configure.in.in b/configure.in.in
index 71efeea..6f41362 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -9,7 +9,7 @@ dnl Written for Xfce by Juha Kautto <juha at xfce.org>
dnl
dnl Version information
-m4_define([orage_version], [4.8.3.6-git])
+m4_define([orage_version], [4.8.3.7-git])
m4_define([gtk_minimum_version], [2.10.0])
m4_define([xfce_minimum_version], [4.6.0])
diff --git a/src/mainbox.c b/src/mainbox.c
index 96296f7..48cf5ae 100644
--- a/src/mainbox.c
+++ b/src/mainbox.c
@@ -487,10 +487,10 @@ static void insert_rows(GList **list, char *a_day, xfical_type ical_type
}
}
-static gint list_order(gconstpointer a, gconstpointer b)
+static gint event_order(gconstpointer a, gconstpointer b)
{
#undef P_N
-#define P_N "list_order: "
+#define P_N "event_order: "
xfical_appt *appt1, *appt2;
#ifdef ORAGE_DEBUG
@@ -502,6 +502,26 @@ static gint list_order(gconstpointer a, gconstpointer b)
return(strcmp(appt1->starttimecur, appt2->starttimecur));
}
+static gint todo_order(gconstpointer a, gconstpointer b)
+{
+#undef P_N
+#define P_N "todo_order: "
+ xfical_appt *appt1, *appt2;
+
+#ifdef ORAGE_DEBUG
+ orage_message(-100, P_N);
+#endif
+ appt1 = (xfical_appt *)a;
+ appt2 = (xfical_appt *)b;
+
+ if (appt1->use_due_time && !appt2->use_due_time)
+ return(-1);
+ if (!appt1->use_due_time && appt2->use_due_time)
+ return(1);
+
+ return(strcmp(appt1->endtimecur, appt2->endtimecur));
+}
+
static void info_process(gpointer a, gpointer pbox)
{
#undef P_N
@@ -649,7 +669,7 @@ static void build_mainbox_todo_info(void)
if (todo_list) {
gtk_widget_destroy(cal->mTodo_vbox);
create_mainbox_todo_info();
- todo_list = g_list_sort(todo_list, list_order);
+ todo_list = g_list_sort(todo_list, todo_order);
g_list_foreach(todo_list, (GFunc)info_process
, cal->mTodo_rows_vbox);
g_list_free(todo_list);
@@ -706,7 +726,7 @@ static void build_mainbox_event_info(void)
if (event_list) {
gtk_widget_destroy(cal->mEvent_vbox);
create_mainbox_event_info_box();
- event_list = g_list_sort(event_list, list_order);
+ event_list = g_list_sort(event_list, event_order);
g_list_foreach(event_list, (GFunc)info_process
, cal->mEvent_rows_vbox);
g_list_free(event_list);
More information about the Xfce4-commits
mailing list