summaryrefslogtreecommitdiff
path: root/gdata
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2009-03-22 14:25:03 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2009-03-22 14:25:03 +0000
commitb24819a5f0feb30bb92cefe8ec63746078383a3c (patch)
treec6a49238bdb2c378b7a1d450a2fc9edfd94c00dd /gdata
parentc3b56e77b05a0f2ccd1f9854ae3d62b11f6c4d94 (diff)
downloadlibgdata-b24819a5f0feb30bb92cefe8ec63746078383a3c.tar.gz
Fixed problems with the progress callback for entry parsing, ensuring
the total_results is the number of results which will actually be retrieved, rather than the number of results available for the search altogether; also ensuring that the callback's called with an equal priority to the ready callback.
Diffstat (limited to 'gdata')
-rw-r--r--gdata/gdata-feed.c11
-rw-r--r--gdata/gdata-query.c4
2 files changed, 10 insertions, 5 deletions
diff --git a/gdata/gdata-feed.c b/gdata/gdata-feed.c
index 50482de8..b0a61383 100644
--- a/gdata/gdata-feed.c
+++ b/gdata/gdata-feed.c
@@ -307,14 +307,19 @@ _gdata_feed_new_from_xml (const gchar *xml, gint length, GDataEntryParserFunc pa
/* Call the progress callback in the main thread */
if (progress_callback != NULL) {
- ProgressCallbackData *data = g_slice_new (ProgressCallbackData);
+ ProgressCallbackData *data;
+
+ /* Build the data for the callback */
+ data = g_slice_new (ProgressCallbackData);
data->progress_callback = progress_callback;
data->progress_user_data = progress_user_data;
data->entry = g_object_ref (entry);
data->entry_i = entry_i;
- data->total_results = total_results;
+ data->total_results = MIN (items_per_page, total_results);
- g_idle_add ((GSourceFunc) progress_callback_idle, data);
+ /* Send the callback; use G_PRIORITY_DEFAULT rather than G_PRIORITY_DEFAULT_IDLE
+ * to contend with the priorities used by the callback functions in GAsyncResult */
+ g_idle_add_full (G_PRIORITY_DEFAULT, (GSourceFunc) progress_callback_idle, data, NULL);
}
entry_i++;
diff --git a/gdata/gdata-query.c b/gdata/gdata-query.c
index 6d655e56..af1ff8c5 100644
--- a/gdata/gdata-query.c
+++ b/gdata/gdata-query.c
@@ -337,9 +337,9 @@ gdata_query_get_query_uri (GDataQuery *self, const gchar *feed_uri)
/* Check to see if we're paginating first */
if (priv->use_next_uri == TRUE)
- return priv->next_uri;
+ return g_strdup (priv->next_uri);
if (priv->use_previous_uri == TRUE)
- return priv->previous_uri;
+ return g_strdup (priv->previous_uri);
/* Check to see if any parameters have been set */
if ((priv->parameter_mask & GDATA_QUERY_PARAM_ALL) == 0)