char *statement;
GList *tasks = NULL;
+ /* FIXME: get the priority */
statement = g_strdup_printf ("SELECT "
- "task_id, name, due_date FROM tasks "
+ "task_id, name, priority, due_date FROM tasks "
"WHERE "
"delete_date IS NULL AND "
"complete_date IS NULL"
rtm_task_set_id (task, (char*)sqlite3_column_text (query, 0));
rtm_task_set_name (task, (char*)sqlite3_column_text (query, 1));
+ rtm_task_set_priority (task,
+ (char*)sqlite3_column_text (query, 2));
- if (db_date_column_to_timeval (query, 2, &timeval))
+ if (db_date_column_to_timeval (query, 3, &timeval))
rtm_task_set_due_date (task, &timeval);
tasks = g_list_prepend (tasks, task);
" ON DELETE CASCADE,"
"name TEXT NOT NULL,"
"local_changes BOOLEAN DEFAULT 0,"
+ "priority TEXT,"
"due_date TEXT,"
"delete_date TEXT,"
"complete_date TEXT,"
GTimeVal *due, *deleted, *completed;
char *name_str, *due_str, *deleted_str, *completed_str;
const char *task_id;
+ const char *priority;
const char *list_id;
const char *taskseries_id;
gint status;
task_id = rtm_task_get_id (task);
task_id = task_id ? task_id : "NULL";
+ priority = rtm_task_get_priority (task);
+ priority = priority ? priority : "N";
+
list_id = rtm_task_get_list_id (task);
list_id = list_id ? list_id : "NULL";
/* all but the name fields are already quoted or NULL */
statement = g_strdup_printf ("INSERT OR REPLACE INTO tasks "
- "('local_id','task_id','name','due_date','delete_date',"
- "'complete_date','list_id','taskseries_id',"
- "'local_changes') "
- "VALUES (%s, %s, '%s', %s, %s, %s, %s, %s, %d)"
+ "('local_id','task_id','name','priority','due_date',"
+ "'delete_date','complete_date','list_id',"
+ "'taskseries_id','local_changes') "
+ "VALUES (%s, %s, '%s', '%s', %s, %s, %s, %s, %s, %d)"
";",
local_id,
task_id,
name_str,
+ priority,
due_str,
deleted_str,
completed_str,
success &= db_insert_or_update_local_task (db, task,
local_id_formatted, local_changes);
+
g_free (local_id_formatted);
return success;
static gboolean
cache_send_receive_changes (MilkCache *cache)
{
- return cache_send_changes (cache) && cache_receive_changes (cache);
+ cache_send_changes (cache);
+ cache_receive_changes (cache);
+
+ return TRUE;
}
static void
priv = MILK_CACHE_PRIVATE (cache);
- /* FIXME: cut this */
- g_debug ("restarting the send/receive poll");
-
if (priv->update_id)
g_source_remove (priv->update_id);