[couchdb-glib] Added missing desktopcouch_document_new function



commit 01fc6b084d9bb4728470b71c4f85bb20ee608986
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Mon May 17 17:52:30 2010 +0200

    Added missing desktopcouch_document_new function

 desktopcouch-glib/desktopcouch-document.c |   25 +++++++++++++++++--------
 desktopcouch-glib/desktopcouch-document.h |   17 +++++++++--------
 desktopcouch-glib/desktopcouch-session.c  |    1 +
 3 files changed, 27 insertions(+), 16 deletions(-)
---
diff --git a/desktopcouch-glib/desktopcouch-document.c b/desktopcouch-glib/desktopcouch-document.c
index 1cc8239..dd1a0d9 100644
--- a/desktopcouch-glib/desktopcouch-document.c
+++ b/desktopcouch-glib/desktopcouch-document.c
@@ -34,6 +34,15 @@ desktopcouch_document_init (DesktopcouchDocument *document)
 }
 
 /**
+ * desktopcouch_document_new:
+ */
+DesktopcouchDocument *
+desktopcouch_document_new (void)
+{
+	return g_object_new (DESKTOPCOUCH_TYPE_DOCUMENT, NULL);
+}
+
+/**
  * desktopcouch_document_get_record_type:
  * @document: A #DesktopcouchDocument object
  *
@@ -47,9 +56,9 @@ desktopcouch_document_init (DesktopcouchDocument *document)
 const char *
 desktopcouch_document_get_record_type (DesktopcouchDocument *document)
 {
-	g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
+	g_return_val_if_fail (DESKTOPCOUCH_IS_DOCUMENT (document), NULL);
 
-	return couchdb_document_get_string_field (document, "record_type");
+	return couchdb_document_get_string_field (COUCHDB_DOCUMENT (document), "record_type");
 }
 
 /**
@@ -62,10 +71,10 @@ desktopcouch_document_get_record_type (DesktopcouchDocument *document)
 void
 desktopcouch_document_set_record_type (DesktopcouchDocument *document, const char *record_type)
 {
-	g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
+	g_return_if_fail (DESKTOPCOUCH_IS_DOCUMENT (document));
 	g_return_if_fail (record_type != NULL);
 
-	couchdb_document_set_string_field (document, "record_type", record_type);
+	couchdb_document_set_string_field (COUCHDB_DOCUMENT (document), "record_type", record_type);
 }
 
 /**
@@ -85,9 +94,9 @@ desktopcouch_document_set_record_type (DesktopcouchDocument *document, const cha
 CouchdbStructField *
 desktopcouch_document_get_application_annotations (DesktopcouchDocument *document)
 {
-	g_return_val_if_fail (COUCHDB_IS_DOCUMENT (document), NULL);
+	g_return_val_if_fail (DESKTOPCOUCH_IS_DOCUMENT (document), NULL);
 
-	return couchdb_document_get_struct_field (document, "application_annotations");
+	return couchdb_document_get_struct_field (COUCHDB_DOCUMENT (document), "application_annotations");
 }
 
 /**
@@ -100,9 +109,9 @@ desktopcouch_document_get_application_annotations (DesktopcouchDocument *documen
 void
 desktopcouch_document_set_application_annotations (DesktopcouchDocument *document, CouchdbStructField *annotations)
 {
-	g_return_if_fail (COUCHDB_IS_DOCUMENT (document));
+	g_return_if_fail (DESKTOPCOUCH_IS_DOCUMENT (document));
 
-	couchdb_document_set_struct_field (document, "application_annotations", annotations);
+	couchdb_document_set_struct_field (COUCHDB_DOCUMENT (document), "application_annotations", annotations);
 }
 
 /**
diff --git a/desktopcouch-glib/desktopcouch-document.h b/desktopcouch-glib/desktopcouch-document.h
index ce7721f..ec4dcf7 100644
--- a/desktopcouch-glib/desktopcouch-document.h
+++ b/desktopcouch-glib/desktopcouch-document.h
@@ -41,19 +41,20 @@ typedef struct {
 	CouchdbDocumentClass parent_class;
 } DesktopcouchDocumentClass;
 
-GType               desktopcouch_document_get_type (void);
+GType                 desktopcouch_document_get_type (void);
+DesktopcouchDocument *desktopcouch_document_new (void);
 
-const char         *desktopcouch_document_get_record_type (DesktopcouchDocument *document);
-void                desktopcouch_document_set_record_type (DesktopcouchDocument *document,
-							   const char *record_type);
+const char           *desktopcouch_document_get_record_type (DesktopcouchDocument *document);
+void                  desktopcouch_document_set_record_type (DesktopcouchDocument *document,
+							     const char *record_type);
 
-CouchdbStructField *desktopcouch_document_get_application_annotations (DesktopcouchDocument *document);
-void                desktopcouch_document_set_application_annotations (DesktopcouchDocument *document,
-								       CouchdbStructField *annotations);
+CouchdbStructField   *desktopcouch_document_get_application_annotations (DesktopcouchDocument *document);
+void                  desktopcouch_document_set_application_annotations (DesktopcouchDocument *document,
+									 CouchdbStructField *annotations);
 
 #define DESKTOPCOUCH_RECORD_TYPE_CONTACT "http://www.freedesktop.org/wiki/Specifications/desktopcouch/contact";
 
-gboolean            desktopcouch_document_is_contact (DesktopcouchDocument *document);
+gboolean              desktopcouch_document_is_contact (DesktopcouchDocument *document);
 
 G_END_DECLS
 
diff --git a/desktopcouch-glib/desktopcouch-session.c b/desktopcouch-glib/desktopcouch-session.c
index ec1c0a2..6d001c1 100644
--- a/desktopcouch-glib/desktopcouch-session.c
+++ b/desktopcouch-glib/desktopcouch-session.c
@@ -22,6 +22,7 @@
 #include <dbus/dbus-glib.h>
 #include <gnome-keyring.h>
 #include <couchdb-glib/utils.h>
+#include "desktopcouch-document-contact.h"
 #include "desktopcouch-session.h"
 
 typedef struct {



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