From 83e45e535a11cc6a80890cba47ca03b812d6ab54 Mon Sep 17 00:00:00 2001 From: Travis Reitter Date: Wed, 24 Mar 2010 21:32:56 -0700 Subject: [PATCH] Fix setting tasks complete (don't crash) --- src/milk-auth.c | 17 +++++++++++++++++ src/milk-cache.c | 11 ++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/milk-auth.c b/src/milk-auth.c index c36db6a..a76cdc8 100644 --- a/src/milk-auth.c +++ b/src/milk-auth.c @@ -391,6 +391,23 @@ milk_auth_task_delete (MilkAuth *auth, return rtm_glib_tasks_delete (priv->rtm_glib, timeline, task, error); } +char* +milk_auth_task_set_priority (MilkAuth *auth, + char *timeline, + RtmTask *task, + const char *priority, + GError **error) +{ + MilkAuthPrivate *priv; + + g_return_val_if_fail (MILK_IS_AUTH (auth), NULL); + + priv = MILK_AUTH_PRIVATE (auth); + + return rtm_glib_tasks_set_priority (priv->rtm_glib, timeline, task, + priority, error); +} + /* FIXME: why does this (or something above it) totally fail if we don't have a * working Internet connection / resolv.conf is mangled? */ /* FIXME: instead of this manual call, listen to the connection manager diff --git a/src/milk-cache.c b/src/milk-cache.c index 24eebff..0f65230 100644 --- a/src/milk-cache.c +++ b/src/milk-cache.c @@ -247,9 +247,10 @@ db_get_tasks_active (sqlite3 *db) char *statement; GList *tasks = NULL; - /* FIXME: get the priority */ statement = g_strdup_printf ("SELECT " - "task_id, name, priority, due_date FROM tasks " + "task_id, name, priority, list_id, taskseries_id, " + "due_date " + "FROM tasks " "WHERE " "delete_date IS NULL AND " "complete_date IS NULL" @@ -280,8 +281,12 @@ db_get_tasks_active (sqlite3 *db) rtm_task_set_name (task, (char*)sqlite3_column_text (query, 1)); rtm_task_set_priority (task, (char*)sqlite3_column_text (query, 2)); + rtm_task_set_list_id (task, + (char*)sqlite3_column_text (query, 3)); + rtm_task_set_taskseries_id (task, + (char*)sqlite3_column_text (query, 4)); - if (db_date_column_to_timeval (query, 3, &timeval)) + if (db_date_column_to_timeval (query, 5, &timeval)) rtm_task_set_due_date (task, &timeval); tasks = g_list_prepend (tasks, task); -- 1.7.9.5