[couchdb-glib] Use the correct JsonObject when calling create_document_from_json_object



commit aa4888b602bdfd36e4721af84deafc17d0ce16d7
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Wed Jul 7 16:17:34 2010 +0200

    Use the correct JsonObject when calling create_document_from_json_object

 couchdb-glib/couchdb-database.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/couchdb-glib/couchdb-database.c b/couchdb-glib/couchdb-database.c
index be4eca5..0b429ba 100644
--- a/couchdb-glib/couchdb-database.c
+++ b/couchdb-glib/couchdb-database.c
@@ -401,7 +401,7 @@ couchdb_database_get_all_documents (CouchdbDatabase *database, GError **error)
 			if (!obj)
 				continue;
 
-			document = create_document_from_json_object (obj);
+			document = create_document_from_json_object (json_object_get_object_member (obj, "doc"));
 			if (document != NULL) {
 				g_object_set (G_OBJECT (document), "database", database, NULL);
 				doclist = g_slist_append (doclist, document);
@@ -472,7 +472,7 @@ couchdb_database_execute_view (CouchdbDatabase *database,
 			if (!obj)
 				continue;
 
-			document = create_document_from_json_object (obj);
+			document = create_document_from_json_object (json_object_get_object_member (obj, "value"));
 
 			if (document != NULL) {
 				couchdb_document_set_id (document, json_object_get_string_member (obj, "id"));



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