summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDebarshi Ray <debarshir@gnome.org>2017-08-09 18:27:25 +0200
committerDebarshi Ray <debarshir@gnome.org>2017-08-14 15:44:56 +0200
commita36efd9357bb8d6f44749ae47f190e4f5ff8b7a5 (patch)
tree5c9dfa768e8be99ea4c38f344ef2e1c6555ecada
parenta627e0e4c586696ead2556eaea36797de2cc25b6 (diff)
downloadlibgdata-a36efd9357bb8d6f44749ae47f190e4f5ff8b7a5.tar.gz
documents: Silence a CRITICAL when querying a feed of entries
Querying a feed of Drive entries using Drive v2 leads to: CRITICAL **: _gdata_query_set_next_uri: assertion 'self->priv->pagination_type == GDATA_QUERY_PAGINATION_URIS' failed When the support for pagination using page tokens was landed in commit 38b934a9ef9dab89, the code in GDataDocumentsService::parse_feed that added the next and previous URIs from the feed to the GDataQuery was generalized and moved to GDataService::parse_feed, and GDataDocumentsQuery was set to use pagination tokens. The intention was to use pagination tokens for GDataDocuments* using only the generic parsing code in the base classes. However, the code in GDataDocumentsFeed::parse_json that added the GDataLinks for the next URI to the feed wasn't removed. This tricks GDataService::parse_feed into using pagination URIs with the corresponding query. This reverts commit fa3e219eff1d4617463a86deb14cb3b1f5fb9a19. https://bugzilla.gnome.org/show_bug.cgi?id=684920
-rw-r--r--gdata/services/documents/gdata-documents-feed.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/gdata/services/documents/gdata-documents-feed.c b/gdata/services/documents/gdata-documents-feed.c
index 91100d51..36370975 100644
--- a/gdata/services/documents/gdata-documents-feed.c
+++ b/gdata/services/documents/gdata-documents-feed.c
@@ -117,23 +117,10 @@ get_kind_and_mime_type (JsonReader *reader, gchar **out_kind, gchar **out_mime_t
static gboolean
parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GError **error)
{
- gboolean success = TRUE;
- gchar *next_uri = NULL;
-
/* JSON format: https://developers.google.com/drive/v2/reference/files/list */
- if (gdata_parser_string_from_json_member (reader, "nextLink", P_DEFAULT, &next_uri, &success, error) == TRUE) {
- if (success && next_uri != NULL && next_uri[0] != '\0') {
- GDataLink *_link;
-
- _link = gdata_link_new (next_uri, "http://www.iana.org/assignments/relation/next");
- _gdata_feed_add_link (GDATA_FEED (parsable), _link);
- g_object_unref (_link);
- }
-
- g_free (next_uri);
- return success;
- } else if (g_strcmp0 (json_reader_get_member_name (reader), "items") == 0) {
+ if (g_strcmp0 (json_reader_get_member_name (reader), "items") == 0) {
+ gboolean success = TRUE;
guint i, elements;
if (json_reader_is_array (reader) == FALSE) {