[libgdata/657539-tasks-tests: 8/19] tasks: Deprecate th e ‘q’ parameter of gdata_tasks_query_new( )



commit c83a01a0eb222999574e2344c702e1a36dc1cb5a
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Aug 31 00:06:02 2014 +0100

    tasks: Deprecate the ‘q’ parameter of gdata_tasks_query_new()
    
    It was never a valid parameter, and we really should have caught this
    before the API was finalised. Deprecate the parameter and document that
    it should only ever have NULL passed to it. Don’t use the parameter
    internally.
    
    This is necessary because Google don’t support the ‘q’ parameter for
    Tasks queries — there is no way to search within task titles or notes.

 gdata/services/tasks/gdata-tasks-query.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gdata/services/tasks/gdata-tasks-query.c b/gdata/services/tasks/gdata-tasks-query.c
index 6f7219d..bbe33d4 100644
--- a/gdata/services/tasks/gdata-tasks-query.c
+++ b/gdata/services/tasks/gdata-tasks-query.c
@@ -355,7 +355,7 @@ get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboo
  * gdata_tasks_query_new:
  * @q: (allow-none): a query string, or %NULL
  *
- * Creates a new #GDataTasksQuery with its #GDataQuery:q property set to @q.
+ * Creates a new #GDataTasksQuery. @q is unused and must be set to %NULL.
  *
  * Return value: a new #GDataTasksQuery
  *
@@ -364,7 +364,9 @@ get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboo
 GDataTasksQuery *
 gdata_tasks_query_new (const gchar *q)
 {
-       return g_object_new (GDATA_TYPE_TASKS_QUERY, "q", q, NULL);
+       /* Ignore the q parameter, as it's not used in any of the queries and
+        * will cause errors. */
+       return g_object_new (GDATA_TYPE_TASKS_QUERY, NULL);
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]