evolution-data-server r10218 - in branches/camel-gobject/camel: . providers/groupwise providers/imap providers/imap4 providers/imapp providers/local providers/nntp providers/pop3 tests/lib tests/smime



Author: mbarnes
Date: Thu Apr 16 00:31:16 2009
New Revision: 10218
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=10218&view=rev

Log:
Last chance commit before the big GIT migration.


Modified:
   branches/camel-gobject/camel/camel-address.c
   branches/camel-gobject/camel/camel-address.h
   branches/camel-gobject/camel/camel-block-file.c
   branches/camel-gobject/camel/camel-block-file.h
   branches/camel-gobject/camel/camel-certdb.c
   branches/camel-gobject/camel/camel-certdb.h
   branches/camel-gobject/camel/camel-cipher-context.c
   branches/camel-gobject/camel/camel-cipher-context.h
   branches/camel-gobject/camel/camel-data-cache.c
   branches/camel-gobject/camel/camel-data-cache.h
   branches/camel-gobject/camel/camel-data-wrapper.c
   branches/camel-gobject/camel/camel-data-wrapper.h
   branches/camel-gobject/camel/camel-digest-folder.c
   branches/camel-gobject/camel/camel-digest-store.c
   branches/camel-gobject/camel/camel-digest-summary.c
   branches/camel-gobject/camel/camel-disco-diary.c
   branches/camel-gobject/camel/camel-filter-driver.c
   branches/camel-gobject/camel/camel-folder-search.c
   branches/camel-gobject/camel/camel-folder-summary.c
   branches/camel-gobject/camel/camel-gpg-context.c
   branches/camel-gobject/camel/camel-html-parser.c
   branches/camel-gobject/camel/camel-html-parser.h
   branches/camel-gobject/camel/camel-http-stream.c
   branches/camel-gobject/camel/camel-index.c
   branches/camel-gobject/camel/camel-internet-address.c
   branches/camel-gobject/camel/camel-medium.c
   branches/camel-gobject/camel/camel-mime-filter-basic.c
   branches/camel-gobject/camel/camel-mime-filter-bestenc.c
   branches/camel-gobject/camel/camel-mime-filter-canon.c
   branches/camel-gobject/camel/camel-mime-filter-charset.c
   branches/camel-gobject/camel/camel-mime-filter-crlf.c
   branches/camel-gobject/camel/camel-mime-filter-enriched.c
   branches/camel-gobject/camel/camel-mime-filter-from.c
   branches/camel-gobject/camel/camel-mime-filter-gzip.c
   branches/camel-gobject/camel/camel-mime-filter-html.c
   branches/camel-gobject/camel/camel-mime-filter-index.c
   branches/camel-gobject/camel/camel-mime-filter-linewrap.c
   branches/camel-gobject/camel/camel-mime-filter-pgp.c
   branches/camel-gobject/camel/camel-mime-filter-progress.c
   branches/camel-gobject/camel/camel-mime-filter-save.c
   branches/camel-gobject/camel/camel-mime-filter-tohtml.c
   branches/camel-gobject/camel/camel-mime-filter-windows.c
   branches/camel-gobject/camel/camel-mime-filter-yenc.c
   branches/camel-gobject/camel/camel-mime-filter.c
   branches/camel-gobject/camel/camel-mime-message.c
   branches/camel-gobject/camel/camel-mime-parser.c
   branches/camel-gobject/camel/camel-mime-part.c
   branches/camel-gobject/camel/camel-multipart-encrypted.c
   branches/camel-gobject/camel/camel-multipart-signed.c
   branches/camel-gobject/camel/camel-multipart.c
   branches/camel-gobject/camel/camel-news-address.c
   branches/camel-gobject/camel/camel-nntp-address.c
   branches/camel-gobject/camel/camel-partition-table.c
   branches/camel-gobject/camel/camel-sasl-anonymous.c
   branches/camel-gobject/camel/camel-sasl.c
   branches/camel-gobject/camel/camel-seekable-substream.c
   branches/camel-gobject/camel/camel-session.c
   branches/camel-gobject/camel/camel-smime-context.c
   branches/camel-gobject/camel/camel-store-summary.c
   branches/camel-gobject/camel/camel-stream-buffer.c
   branches/camel-gobject/camel/camel-stream-filter.c
   branches/camel-gobject/camel/camel-stream-fs.c
   branches/camel-gobject/camel/camel-stream-mem.c
   branches/camel-gobject/camel/camel-stream-null.c
   branches/camel-gobject/camel/camel-stream-process.c
   branches/camel-gobject/camel/camel-stream-vfs.c
   branches/camel-gobject/camel/camel-tcp-stream-openssl.c
   branches/camel-gobject/camel/camel-tcp-stream-raw.c
   branches/camel-gobject/camel/camel-tcp-stream-ssl.c
   branches/camel-gobject/camel/camel-text-index.c
   branches/camel-gobject/camel/camel-vee-folder.c
   branches/camel-gobject/camel/camel-vee-store.c
   branches/camel-gobject/camel/camel-vee-summary.c
   branches/camel-gobject/camel/camel-vtrash-folder.c
   branches/camel-gobject/camel/providers/groupwise/camel-groupwise-folder.c
   branches/camel-gobject/camel/providers/groupwise/camel-groupwise-journal.c
   branches/camel-gobject/camel/providers/groupwise/camel-groupwise-store-summary.c
   branches/camel-gobject/camel/providers/groupwise/camel-groupwise-store.c
   branches/camel-gobject/camel/providers/groupwise/camel-groupwise-summary.c
   branches/camel-gobject/camel/providers/imap/camel-imap-folder.c
   branches/camel-gobject/camel/providers/imap/camel-imap-journal.c
   branches/camel-gobject/camel/providers/imap/camel-imap-message-cache.c
   branches/camel-gobject/camel/providers/imap/camel-imap-search.c
   branches/camel-gobject/camel/providers/imap/camel-imap-store-summary.c
   branches/camel-gobject/camel/providers/imap/camel-imap-summary.c
   branches/camel-gobject/camel/providers/imap/camel-imap-wrapper.c
   branches/camel-gobject/camel/providers/imap4/camel-imap4-engine.c
   branches/camel-gobject/camel/providers/imap4/camel-imap4-folder.c
   branches/camel-gobject/camel/providers/imap4/camel-imap4-journal.c
   branches/camel-gobject/camel/providers/imap4/camel-imap4-search.c
   branches/camel-gobject/camel/providers/imap4/camel-imap4-store-summary.c
   branches/camel-gobject/camel/providers/imap4/camel-imap4-stream.c
   branches/camel-gobject/camel/providers/imap4/camel-imap4-summary.c
   branches/camel-gobject/camel/providers/imapp/camel-imapp-driver.c
   branches/camel-gobject/camel/providers/imapp/camel-imapp-engine.c
   branches/camel-gobject/camel/providers/imapp/camel-imapp-fetch-stream.c
   branches/camel-gobject/camel/providers/imapp/camel-imapp-folder.c
   branches/camel-gobject/camel/providers/imapp/camel-imapp-store-summary.c
   branches/camel-gobject/camel/providers/imapp/camel-imapp-stream.c
   branches/camel-gobject/camel/providers/imapp/camel-imapp-summary.c
   branches/camel-gobject/camel/providers/local/camel-local-summary.c
   branches/camel-gobject/camel/providers/local/camel-maildir-folder.c
   branches/camel-gobject/camel/providers/local/camel-maildir-summary.c
   branches/camel-gobject/camel/providers/local/camel-mbox-folder.c
   branches/camel-gobject/camel/providers/local/camel-mbox-summary.c
   branches/camel-gobject/camel/providers/local/camel-mh-folder.c
   branches/camel-gobject/camel/providers/local/camel-mh-summary.c
   branches/camel-gobject/camel/providers/local/camel-spool-folder.c
   branches/camel-gobject/camel/providers/local/camel-spool-summary.c
   branches/camel-gobject/camel/providers/nntp/camel-nntp-folder.c
   branches/camel-gobject/camel/providers/nntp/camel-nntp-store-summary.c
   branches/camel-gobject/camel/providers/nntp/camel-nntp-stream.c
   branches/camel-gobject/camel/providers/nntp/camel-nntp-summary.c
   branches/camel-gobject/camel/providers/pop3/camel-pop3-engine.c
   branches/camel-gobject/camel/providers/pop3/camel-pop3-folder.c
   branches/camel-gobject/camel/providers/pop3/camel-pop3-stream.c
   branches/camel-gobject/camel/tests/lib/messages.c
   branches/camel-gobject/camel/tests/lib/session.c
   branches/camel-gobject/camel/tests/smime/pgp-mime.c
   branches/camel-gobject/camel/tests/smime/pgp.c
   branches/camel-gobject/camel/tests/smime/pkcs7.c

Modified: branches/camel-gobject/camel/camel-address.c
==============================================================================
--- branches/camel-gobject/camel/camel-address.c	(original)
+++ branches/camel-gobject/camel/camel-address.c	Thu Apr 16 00:31:16 2009
@@ -20,47 +20,53 @@
 
 #include "camel-address.h"
 
-
-static void camel_address_class_init (CamelAddressClass *klass);
-static void camel_address_init       (CamelAddress *obj);
-static void camel_address_finalize   (CamelObject *obj);
-
-static CamelObjectClass *camel_address_parent;
+static gpointer parent_class;
 
 static void
-camel_address_class_init (CamelAddressClass *klass)
+camel_address_finalize (GObject *object)
 {
-	camel_address_parent = g_type_class_peek (camel_object_get_type ());
+	CamelAddress *address = CAMEL_ADDRESS (object);
+
+	camel_address_remove (address, -1);
+	g_ptr_array_free (address->addresses, TRUE);
+
+	/* Chain up to parent's finalize() method. */
+	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
 static void
-camel_address_init (CamelAddress *obj)
+camel_address_class_init (CamelAddressClass *class)
 {
-	obj->addresses = g_ptr_array_new();
+	GObjectClass *object_class;
+
+	parent_class = g_type_class_peek_parent (class);
+
+	object_class = G_OBJECT_CLASS (class);
+	object_class->finalize = camel_address_finalize;
 }
 
 static void
-camel_address_finalize (CamelObject *obj)
+camel_address_init (CamelAddress *address)
 {
-	camel_address_remove((CamelAddress *)obj, -1);
-	g_ptr_array_free(((CamelAddress *)obj)->addresses, TRUE);
+	address->addresses = g_ptr_array_new();
 }
 
 GType
 camel_address_get_type (void)
 {
-	static GType type = G_TYPE_INVALID;
-	
-	if (type == G_TYPE_INVALID) {
-		type = camel_type_register (camel_object_get_type (), "CamelAddress",
-					    sizeof (CamelAddress),
-					    sizeof (CamelAddressClass),
-					    (CamelObjectClassInitFunc) camel_address_class_init,
-					    NULL,
-					    (CamelObjectInitFunc) camel_address_init,
-					    (CamelObjectFinalizeFunc) camel_address_finalize);
+	static GType type = 0;
+
+	if (G_UNLIKELY (type == 0)) {
+		type = g_type_register_static_simple (
+			CAMEL_TYPE_OBJECT,
+			"CamelAddress",
+			sizeof (CamelAddressClass),
+			(GClassInitFunc) camel_address_class_init,
+			sizeof (CamelAddress),
+			(GInstanceInitFunc) camel_address_init,
+			0);
 	}
-	
+
 	return type;
 }
 
@@ -74,8 +80,7 @@
 CamelAddress *
 camel_address_new (void)
 {
-	CamelAddress *new = CAMEL_ADDRESS(camel_object_new(camel_address_get_type()));
-	return new;
+	return g_object_new (CAMEL_TYPE_ADDRESS, NULL);
 }
 
 
@@ -90,9 +95,11 @@
 CamelAddress *
 camel_address_new_clone (const CamelAddress *addr)
 {
-	CamelAddress *new = CAMEL_ADDRESS(camel_object_new(G_OBJECT_TYPE(addr)));
+	CamelAddress *new;
+
+	new = g_object_new (CAMEL_TYPE_ADDRESS, NULL);
+	camel_address_cat (new, addr);
 
-	camel_address_cat(new, addr);
 	return new;
 }
 

Modified: branches/camel-gobject/camel/camel-address.h
==============================================================================
--- branches/camel-gobject/camel/camel-address.h	(original)
+++ branches/camel-gobject/camel/camel-address.h	Thu Apr 16 00:31:16 2009
@@ -25,9 +25,24 @@
 #include <glib.h>
 #include <camel/camel-object.h>
 
-#define CAMEL_ADDRESS(obj)         G_TYPE_CHECK_INSTANCE_CAST (obj, camel_address_get_type (), CamelAddress)
-#define CAMEL_ADDRESS_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, camel_address_get_type (), CamelAddressClass)
-#define CAMEL_IS_ADDRESS(obj)      G_TYPE_CHECK_INSTANCE_TYPE (obj, camel_address_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_ADDRESS \
+	(camel_address_get_type ())
+#define CAMEL_ADDRESS(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), CAMEL_TYPE_ADDRESS, CamelAddress))
+#define CAMEL_ADDRESS_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), CAMEL_TYPE_ADDRESS, CamelAddressClass))
+#define CAMEL_IS_ADDRESS(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), CAMEL_TYPE_ADDRESS))
+#define CAMEL_IS_ADDRESS_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), CAMEL_TYPE_ADDRESS))
+#define CAMEL_ADDRESS_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), CAMEL_TYPE_ADDRESS, CamelAddressClass))
 
 G_BEGIN_DECLS
 

Modified: branches/camel-gobject/camel/camel-block-file.c
==============================================================================
--- branches/camel-gobject/camel/camel-block-file.c	(original)
+++ branches/camel-gobject/camel/camel-block-file.c	Thu Apr 16 00:31:16 2009
@@ -42,6 +42,8 @@
 
 #define d(x) /*(printf("%s(%d):%s: ",  __FILE__, __LINE__, __PRETTY_FUNCTION__),(x))*/
 
+static gpointer block_file_parent_class;
+
 /* Locks must be obtained in the order defined */
 
 struct _CamelBlockFilePrivate {
@@ -75,8 +77,6 @@
 static int block_file_count = 0;
 static int block_file_threshhold = 10;
 
-#define CBF_CLASS(o) ((CamelBlockFileClass *)(((CamelObject *)o)->klass))
-
 static int sync_nolock(CamelBlockFile *bs);
 static int sync_block_nolock(CamelBlockFile *bs, CamelBlock *bl);
 
@@ -145,10 +145,64 @@
 }
 
 static void
-camel_block_file_class_init(CamelBlockFileClass *klass)
+camel_block_file_finalize(GObject *object)
+{
+	CamelBlockFile *bs = CAMEL_BLOCK_FILE (object);
+	CamelBlock *bl, *bn;
+	struct _CamelBlockFilePrivate *p;
+
+	p = bs->priv;
+
+	if (bs->root_block)
+		camel_block_file_sync(bs);
+
+	/* remove from lru list */
+	LOCK(block_file_lock);
+	if (bs->fd != -1)
+		block_file_count--;
+	camel_dlist_remove((CamelDListNode *)p);
+	UNLOCK(block_file_lock);
+
+	bl = (CamelBlock *)bs->block_cache.head;
+	bn = bl->next;
+	while (bn) {
+		if (bl->refcount != 0)
+			g_warning("Block '%u' still referenced", bl->id);
+		g_free(bl);
+		bl = bn;
+		bn = bn->next;
+	}
+	
+	g_hash_table_destroy (bs->blocks);
+	
+	if (bs->root_block)
+		camel_block_file_unref_block(bs, bs->root_block);
+	g_free(bs->path);
+	if (bs->fd != -1)
+		close(bs->fd);
+	
+	pthread_mutex_destroy(&p->io_lock);
+	pthread_mutex_destroy(&p->cache_lock);
+	pthread_mutex_destroy(&p->root_lock);
+	
+	g_free(p);
+
+	/* Chain up to parent's finalize() method. */
+	G_OBJECT_CLASS (block_file_parent_class)->finalize (object);
+}
+
+static void
+camel_block_file_class_init(CamelBlockFileClass *class)
 {
-	klass->validate_root = block_file_validate_root;
-	klass->init_root = block_file_init_root;
+	GObjectClass *object_class;
+
+	block_file_parent_class = g_type_class_peek_parent (class);
+
+	object_class = G_OBJECT_CLASS (class);
+	object_class->finalize = camel_block_file_finalize;
+
+	class->validate_root = block_file_validate_root;
+	class->init_root = block_file_init_root;
 }
 
 static guint
@@ -196,63 +250,20 @@
 	UNLOCK(block_file_lock);
 }
 
-static void
-camel_block_file_finalise(CamelBlockFile *bs)
-{
-	CamelBlock *bl, *bn;
-	struct _CamelBlockFilePrivate *p;
-
-	p = bs->priv;
-
-	if (bs->root_block)
-		camel_block_file_sync(bs);
-
-	/* remove from lru list */
-	LOCK(block_file_lock);
-	if (bs->fd != -1)
-		block_file_count--;
-	camel_dlist_remove((CamelDListNode *)p);
-	UNLOCK(block_file_lock);
-
-	bl = (CamelBlock *)bs->block_cache.head;
-	bn = bl->next;
-	while (bn) {
-		if (bl->refcount != 0)
-			g_warning("Block '%u' still referenced", bl->id);
-		g_free(bl);
-		bl = bn;
-		bn = bn->next;
-	}
-	
-	g_hash_table_destroy (bs->blocks);
-	
-	if (bs->root_block)
-		camel_block_file_unref_block(bs, bs->root_block);
-	g_free(bs->path);
-	if (bs->fd != -1)
-		close(bs->fd);
-	
-	pthread_mutex_destroy(&p->io_lock);
-	pthread_mutex_destroy(&p->cache_lock);
-	pthread_mutex_destroy(&p->root_lock);
-	
-	g_free(p);
-}
-
 GType
 camel_block_file_get_type(void)
 {
-	static GType type = G_TYPE_INVALID;
+	static GType type = 0;
 	
-	if (type == G_TYPE_INVALID) {
-		type = camel_type_register(camel_object_get_type(), "CamelBlockFile",
-					   sizeof (CamelBlockFile),
-					   sizeof (CamelBlockFileClass),
-					   (CamelObjectClassInitFunc) camel_block_file_class_init,
-					   NULL,
-					   (CamelObjectInitFunc) camel_block_file_init,
-					   (CamelObjectFinalizeFunc) camel_block_file_finalise);
-	}
+	if (G_UNLIKELY (type == 0))
+		type = g_type_register_static_simple (
+			CAMEL_TYPE_OBJECT,
+			"CamelBlockFile",
+			sizeof (CamelBlockFileClass),
+			(GClassInitFunc) camel_block_file_class_init,
+			sizeof (CamelBlockFile),
+			(GInstanceInitFunc) camel_block_file_init,
+			0);
 	
 	return type;
 }
@@ -364,9 +375,10 @@
  **/
 CamelBlockFile *camel_block_file_new(const char *path, int flags, const char version[8], size_t block_size)
 {
+	CamelBlockFileClass *class;
 	CamelBlockFile *bs;
 
-	bs = (CamelBlockFile *)camel_object_new(camel_block_file_get_type());
+	bs = g_object_new (CAMEL_TYPE_BLOCK_FILE, NULL);
 	memcpy(bs->version, version, 8);
 	bs->path = g_strdup(path);
 	bs->flags = flags;
@@ -382,11 +394,13 @@
 	/* we only need these flags on first open */
 	bs->flags &= ~(O_CREAT|O_EXCL|O_TRUNC);
 
+	class = CAMEL_BLOCK_FILE_GET_CLASS (bs);
+
 	/* Do we need to init the root block? */
-	if (CBF_CLASS(bs)->validate_root(bs) == -1) {
+	if (class->validate_root(bs) == -1) {
 		d(printf("Initialise root block: %.8s\n", version));
 
-		CBF_CLASS(bs)->init_root(bs);
+		class->init_root(bs);
 		camel_block_file_touch_block(bs, bs->root_block);
 		if (block_file_use(bs) == -1) {
 			g_object_unref((CamelObject *)bs);
@@ -795,6 +809,8 @@
 
 /* ********************************************************************** */
 
+static gpointer key_file_parent_class;
+
 struct _CamelKeyFilePrivate {
 	struct _CamelKeyFilePrivate *next;
 	struct _CamelKeyFilePrivate *prev;
@@ -817,28 +833,9 @@
 static const int key_file_threshhold = 10;
 
 static void
-camel_key_file_class_init(CamelKeyFileClass *klass)
-{
-}
-
-static void
-camel_key_file_init(CamelKeyFile *bs)
-{
-	struct _CamelKeyFilePrivate *p;
-
-	p = bs->priv = g_malloc0(sizeof(*bs->priv));
-	p->base = bs;
-	
-	pthread_mutex_init(&p->lock, NULL);
-	
-	LOCK(key_file_lock);
-	camel_dlist_addhead(&key_file_list, (CamelDListNode *)p);
-	UNLOCK(key_file_lock);
-}
-
-static void
-camel_key_file_finalise(CamelKeyFile *bs)
+camel_key_file_finalize(GObject *object)
 {
+	CamelKeyFile *bs = CAMEL_KEY_FILE (object);
 	struct _CamelKeyFilePrivate *p = bs->priv;
 
 	LOCK(key_file_lock);
@@ -856,23 +853,52 @@
 	pthread_mutex_destroy(&p->lock);
 	
 	g_free(p);
+
+	/* Chain up to parent's finalize() method. */
+	G_OBJECT_CLASS (key_file_parent_class)->finalize (object);
 }
 
-GType
-camel_key_file_get_type(void)
+static void
+camel_key_file_class_init(CamelKeyFileClass *class)
+{
+	GObjectClass *object_class;
+
+	key_file_parent_class = g_type_class_peek_parent (class);
+
+	object_class = G_OBJECT_CLASS (class);
+	object_class->finalize = camel_key_file_finalize;
+}
+
+static void
+camel_key_file_init(CamelKeyFile *bs)
 {
-	static GType type = G_TYPE_INVALID;
+	struct _CamelKeyFilePrivate *p;
+
+	p = bs->priv = g_malloc0(sizeof(*bs->priv));
+	p->base = bs;
 	
-	if (type == G_TYPE_INVALID) {
-		type = camel_type_register(camel_object_get_type(), "CamelKeyFile",
-					   sizeof (CamelKeyFile),
-					   sizeof (CamelKeyFileClass),
-					   (CamelObjectClassInitFunc) camel_key_file_class_init,
-					   NULL,
-					   (CamelObjectInitFunc) camel_key_file_init,
-					   (CamelObjectFinalizeFunc) camel_key_file_finalise);
-	}
+	pthread_mutex_init(&p->lock, NULL);
 	
+	LOCK(key_file_lock);
+	camel_dlist_addhead(&key_file_list, (CamelDListNode *)p);
+	UNLOCK(key_file_lock);
+}
+
+GType
+camel_key_file_get_type(void)
+{
+	static GType type = 0;
+
+	if (G_UNLIKELY (type == 0))
+		type = g_type_register_static_simple (
+			CAMEL_TYPE_OBJECT,
+			"CamelKeyFile",
+			sizeof (CamelKeyFileClass),
+			(GClassInitFunc) camel_key_file_class_init,
+			sizeof (CamelKeyFile),
+			(GInstanceInitFunc) camel_key_file_init,
+			0);
+
 	return type;
 }
 
@@ -985,7 +1011,7 @@
 
 	d(printf("New key file '%s'\n", path));
 
-	kf = (CamelKeyFile *)camel_object_new(camel_key_file_get_type());
+	kf = g_object_new (CAMEL_TYPE_KEY_FILE, NULL);
 	kf->path = g_strdup(path);
 	kf->fp = NULL;
 	kf->flags = flags;

Modified: branches/camel-gobject/camel/camel-block-file.h
==============================================================================
--- branches/camel-gobject/camel/camel-block-file.h	(original)
+++ branches/camel-gobject/camel/camel-block-file.h	Thu Apr 16 00:31:16 2009
@@ -27,6 +27,43 @@
 #include <stdio.h>
 #include <sys/types.h>
 
+/* Standard GObject macros */
+#define CAMEL_TYPE_BLOCK_FILE \
+	(camel_block_file_get_type ())
+#define CAMEL_BLOCK_FILE(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), CAMEL_TYPE_BLOCK_FILE, CamelBlockFile))
+#define CAMEL_BLOCK_FILE_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), CAMEL_TYPE_BLOCK_FILE, CamelBlockFileClass))
+#define CAMEL_IS_BLOCK_FILE(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), CAMEL_TYPE_BLOCK_FILE))
+#define CAMEL_IS_BLOCK_FILE_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), CAMEL_TYPE_BLOCK_FILE))
+#define CAMEL_BLOCK_FILE_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), CAMEL_TYPE_BLOCK_FILE, CamelBlockFileClass))
+
+#define CAMEL_TYPE_KEY_FILE \
+	(camel_key_file_get_type ())
+#define CAMEL_KEY_FILE(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), CAMEL_TYPE_KEY_FILE, CamelKeyFile))
+#define CAMEL_KEY_FILE_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), CAMEL_TYPE_KEY_FILE, CamelKeyFileClass))
+#define CAMEL_IS_KEY_FILE(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), CAMEL_TYPE_KEY_FILE))
+#define CAMEL_IS_KEY_FILE_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), CAMEL_TYPE_KEY_FILE))
+#define CAMEL_KEY_FILE_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), CAMEL_TYPE_KEY_FILE, CamelKeyFileClass))
+
 G_BEGIN_DECLS
 
 typedef guint32 camel_block_t;	/* block offset, absolute, bottom BLOCK_SIZE_BITS always 0 */

Modified: branches/camel-gobject/camel/camel-certdb.c
==============================================================================
--- branches/camel-gobject/camel/camel-certdb.c	(original)
+++ branches/camel-gobject/camel/camel-certdb.c	Thu Apr 16 00:31:16 2009
@@ -155,7 +155,7 @@
 CamelCertDB *
 camel_certdb_new (void)
 {
-	return (CamelCertDB *) camel_object_new (camel_certdb_get_type ());
+	return g_object_new (CAMEL_TYPE_CERTDB, NULL);
 }
 
 

Modified: branches/camel-gobject/camel/camel-certdb.h
==============================================================================
--- branches/camel-gobject/camel/camel-certdb.h	(original)
+++ branches/camel-gobject/camel/camel-certdb.h	Thu Apr 16 00:31:16 2009
@@ -27,10 +27,24 @@
 #include <stdio.h>
 #include <camel/camel-object.h>
 
-#define CAMEL_CERTDB_TYPE         (camel_certdb_get_type ())
-#define CAMEL_CERTDB(obj)         (G_TYPE_CHECK_INSTANCE_CAST (obj, camel_certdb_get_type (), CamelCertDB))
-#define CAMEL_CERTDB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, camel_certdb_get_type (), CamelCertDBClass))
-#define CAMEL_IS_CERTDB(obj)      (G_TYPE_CHECK_INSTANCE_TYPE (obj, camel_certdb_get_type ()))
+/* Standard GObject macros */
+#define CAMEL_TYPE_CERTDB \
+	(camel_certdb_get_type ())
+#define CAMEL_CERTDB(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), CAMEL_TYPE_CERTDB, CamelCertDB))
+#define CAMEL_CERTDB_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), CAMEL_TYPE_CERTDB, CamelCertDBClass))
+#define CAMEL_IS_CERTDB(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), CAMEL_TYPE_CERTDB))
+#define CAMEL_IS_CERTDB_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), CAMEL_TYPE_CERTDB))
+#define CAMEL_CERTDB_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), CAMEL_TYPE_CERTDB, CamelCertDBClass))
 
 G_BEGIN_DECLS
 

Modified: branches/camel-gobject/camel/camel-cipher-context.c
==============================================================================
--- branches/camel-gobject/camel/camel-cipher-context.c	(original)
+++ branches/camel-gobject/camel/camel-cipher-context.c	Thu Apr 16 00:31:16 2009
@@ -69,10 +69,8 @@
 	
 	g_return_val_if_fail (session != NULL, NULL);
 	
-	context = CAMEL_CIPHER_CONTEXT (camel_object_new (CAMEL_CIPHER_CONTEXT_TYPE));
-	
-	g_object_ref (session);
-	context->session = session;
+	context = g_object_new (CAMEL_TYPE_CIPHER_CONTEXT, NULL);
+	context->session = g_object_ref (session);
 	
 	return context;
 }
@@ -555,7 +553,7 @@
 }
 
 static void
-camel_cipher_context_finalise (CamelObject *o)
+camel_cipher_context_finalize (CamelObject *o)
 {
 	CamelCipherContext *context = (CamelCipherContext *)o;
 	
@@ -594,7 +592,7 @@
 					    (CamelObjectClassInitFunc) camel_cipher_context_class_init,
 					    NULL,
 					    (CamelObjectInitFunc) camel_cipher_context_init,
-					    (CamelObjectFinalizeFunc) camel_cipher_context_finalise);
+					    (CamelObjectFinalizeFunc) camel_cipher_context_finalize);
 	}
 	
 	return type;

Modified: branches/camel-gobject/camel/camel-cipher-context.h
==============================================================================
--- branches/camel-gobject/camel/camel-cipher-context.h	(original)
+++ branches/camel-gobject/camel/camel-cipher-context.h	Thu Apr 16 00:31:16 2009
@@ -27,10 +27,24 @@
 #include <camel/camel-session.h>
 #include <camel/camel-exception.h>
 
-#define CAMEL_CIPHER_CONTEXT_TYPE     (camel_cipher_context_get_type ())
-#define CAMEL_CIPHER_CONTEXT(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), CAMEL_CIPHER_CONTEXT_TYPE, CamelCipherContext))
-#define CAMEL_CIPHER_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CAMEL_CIPHER_CONTEXT_TYPE, CamelCipherContextClass))
-#define CAMEL_IS_CIPHER_CONTEXT(o)    (G_TYPE_CHECK_INSTANCE_TYPE((o), CAMEL_CIPHER_CONTEXT_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_CIPHER_CONTEXT \
+	(camel_cipher_context_get_type ())
+#define CAMEL_CIPHER_CONTEXT(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), CAMEL_TYPE_CIPHER_CONTEXT, CamelCipherContext))
+#define CAMEL_CIPHER_CONTEXT_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), CAMEL_TYPE_CIPHER_CONTEXT, CamelCipherContextClass))
+#define CAMEL_IS_CIPHER_CONTEXT(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), CAMEL_TYPE_CIPHER_CONTEXT))
+#define CAMEL_IS_CIPHER_CONTEXT_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), CAMEL_TYPE_CIPHER_CONTEXT))
+#define CAMEL_CIPHER_CONTEXT_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), CAMEL_TYPE_CIPHER_CONTEXT, CamelCipherContextClass))
 
 G_BEGIN_DECLS
 

Modified: branches/camel-gobject/camel/camel-data-cache.c
==============================================================================
--- branches/camel-gobject/camel/camel-data-cache.c	(original)
+++ branches/camel-gobject/camel/camel-data-cache.c	Thu Apr 16 00:31:16 2009
@@ -85,7 +85,7 @@
 	p->busy_bag = camel_object_bag_new(g_str_hash, g_str_equal, (CamelCopyFunc)g_strdup, g_free);
 }
 
-static void data_cache_finalise(CamelDataCache *cdc)
+static void data_cache_finalize(CamelDataCache *cdc)
 {
 	struct _CamelDataCachePrivate *p;
 
@@ -109,7 +109,7 @@
 			(CamelObjectClassInitFunc) data_cache_class_init,
 			NULL,
 			(CamelObjectInitFunc) data_cache_init,
-			(CamelObjectFinalizeFunc) data_cache_finalise);
+			(CamelObjectFinalizeFunc) data_cache_finalize);
 	}
 
 	return camel_data_cache_type;
@@ -137,7 +137,7 @@
 		return NULL;
 	}
 
-	cdc = (CamelDataCache *)camel_object_new(CAMEL_DATA_CACHE_TYPE);
+	cdc = g_object_new (CAMEL_TYPE_DATA_CACHE, NULL);
 
 	cdc->path = g_strdup(path);
 	cdc->flags = flags;

Modified: branches/camel-gobject/camel/camel-data-cache.h
==============================================================================
--- branches/camel-gobject/camel/camel-data-cache.h	(original)
+++ branches/camel-gobject/camel/camel-data-cache.h	Thu Apr 16 00:31:16 2009
@@ -29,10 +29,24 @@
 #include <camel/camel-stream.h>
 #include <camel/camel-exception.h>
 
-#define CAMEL_DATA_CACHE_TYPE     (camel_data_cache_get_type ())
-#define CAMEL_DATA_CACHE(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), CAMEL_DATA_CACHE_TYPE, CamelFolder))
-#define CAMEL_DATA_CACHE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CAMEL_DATA_CACHE_TYPE, CamelFolderClass))
-#define CAMEL_IS_DATA_CACHE(o)    (G_TYPE_CHECK_INSTANCE_TYPE((o), CAMEL_DATA_CACHE_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_DATA_CACHE \
+	(camel_data_cache_get_type ())
+#define CAMEL_DATA_CACHE(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), CAMEL_TYPE_DATA_CACHE, CamelDataCache))
+#define CAMEL_DATA_CACHE_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), CAMEL_TYPE_DATA_CACHE, CamelDataCacheClass))
+#define CAMEL_IS_DATA_CACHE(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), CAMEL_TYPE_DATA_CACHE))
+#define CAMEL_IS_DATA_CACHE_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), CAMEL_TYPE_DATA_CACHE))
+#define CAMEL_DATA_CACHE_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), CAMEL_TYPE_DATA_CACHE, CamelDataCacheClass))
 
 G_BEGIN_DECLS
 

Modified: branches/camel-gobject/camel/camel-data-wrapper.c
==============================================================================
--- branches/camel-gobject/camel/camel-data-wrapper.c	(original)
+++ branches/camel-gobject/camel/camel-data-wrapper.c	Thu Apr 16 00:31:16 2009
@@ -126,7 +126,7 @@
 CamelDataWrapper *
 camel_data_wrapper_new (void)
 {
-	return (CamelDataWrapper *) camel_object_new (CAMEL_DATA_WRAPPER_TYPE);
+	return g_object_new (CAMEL_TYPE_DATA_WRAPPER, NULL);
 }
 
 static ssize_t

Modified: branches/camel-gobject/camel/camel-data-wrapper.h
==============================================================================
--- branches/camel-gobject/camel/camel-data-wrapper.h	(original)
+++ branches/camel-gobject/camel/camel-data-wrapper.h	Thu Apr 16 00:31:16 2009
@@ -31,10 +31,24 @@
 #include <camel/camel-object.h>
 #include <camel/camel-mime-utils.h>
 
-#define CAMEL_DATA_WRAPPER_TYPE     (camel_data_wrapper_get_type ())
-#define CAMEL_DATA_WRAPPER(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj), CAMEL_DATA_WRAPPER_TYPE, CamelDataWrapper))
-#define CAMEL_DATA_WRAPPER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CAMEL_DATA_WRAPPER_TYPE, CamelDataWrapperClass))
-#define CAMEL_IS_DATA_WRAPPER(o)    (G_TYPE_CHECK_INSTANCE_TYPE((o), CAMEL_DATA_WRAPPER_TYPE))
+/* Standard GObject macros */
+#define CAMEL_TYPE_DATA_WRAPPER \
+	(camel_data_wrapper_get_type ())
+#define CAMEL_DATA_WRAPPER(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), CAMEL_TYPE_DATA_WRAPPER, CamelDataWrapper))
+#define CAMEL_DATA_WRAPPER_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), CAMEL_TYPE_DATA_WRAPPER, CamelDataWrapperClass))
+#define CAMEL_IS_DATA_WRAPPER(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), CAMEL_TYPE_DATA_WRAPPER))
+#define CAMEL_IS_DATA_WRAPPER_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), CAMEL_TYPE_DATA_WRAPPER))
+#define CAMEL_DATA_WRAPPER_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), CAMEL_TYPE_DATA_WRAPPER, CamelDataWrapperClass))
 
 G_BEGIN_DECLS
 

Modified: branches/camel-gobject/camel/camel-digest-folder.c
==============================================================================
--- branches/camel-gobject/camel/camel-digest-folder.c	(original)
+++ branches/camel-gobject/camel/camel-digest-folder.c	Thu Apr 16 00:31:16 2009
@@ -228,7 +228,7 @@
 			return NULL;
 	}
 	
-	folder = CAMEL_FOLDER (camel_object_new (camel_digest_folder_get_type ()));
+	folder = g_object_new (CAMEL_TYPE_DIGEST_FOLDER, NULL);
 	digest_folder = CAMEL_DIGEST_FOLDER (folder);
 	
 	camel_folder_construct (folder, parent_store, "folder_name", "short_name");

Modified: branches/camel-gobject/camel/camel-digest-store.c
==============================================================================
--- branches/camel-gobject/camel/camel-digest-store.c	(original)
+++ branches/camel-gobject/camel/camel-digest-store.c	Thu Apr 16 00:31:16 2009
@@ -44,7 +44,7 @@
 
 static void camel_digest_store_class_init (CamelDigestStoreClass *klass);
 static void camel_digest_store_init       (CamelDigestStore *obj);
-static void camel_digest_store_finalise   (CamelObject *obj);
+static void camel_digest_store_finalize   (CamelObject *obj);
 
 static int digest_setv (CamelObject *object, CamelException *ex, CamelArgV *args);
 static int digest_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args);
@@ -65,7 +65,7 @@
 					    (CamelObjectClassInitFunc) camel_digest_store_class_init,
 					    NULL,
 					    (CamelObjectInitFunc) camel_digest_store_init,
-					    (CamelObjectFinalizeFunc) camel_digest_store_finalise);
+					    (CamelObjectFinalizeFunc) camel_digest_store_finalize);
 	}
 	
 	return type;
@@ -103,7 +103,7 @@
 }
 
 static void
-camel_digest_store_finalise (CamelObject *obj)
+camel_digest_store_finalize (CamelObject *obj)
 {
 	
 }
@@ -141,7 +141,7 @@
 	if (!uri)
 		return NULL;
 	
-	store = CAMEL_STORE (camel_object_new (camel_digest_store_get_type ()));
+	store = g_object_new (CAMEL_TYPE_DIGEST_STORE, NULL);
 	CAMEL_SERVICE (store)->url = uri;
 	
 	return store;

Modified: branches/camel-gobject/camel/camel-digest-summary.c
==============================================================================
--- branches/camel-gobject/camel/camel-digest-summary.c	(original)
+++ branches/camel-gobject/camel/camel-digest-summary.c	Thu Apr 16 00:31:16 2009
@@ -31,7 +31,7 @@
 
 static void camel_digest_summary_class_init (CamelDigestSummaryClass *klass);
 static void camel_digest_summary_init       (CamelDigestSummary *obj);
-static void camel_digest_summary_finalise   (CamelObject *obj);
+static void camel_digest_summary_finalize   (CamelObject *obj);
 
 
 static CamelFolderSummaryClass *parent_class = NULL;
@@ -51,7 +51,7 @@
 			(CamelObjectClassInitFunc) camel_digest_summary_class_init,
 			NULL,
 			(CamelObjectInitFunc) camel_digest_summary_init,
-			(CamelObjectFinalizeFunc) camel_digest_summary_finalise);
+			(CamelObjectFinalizeFunc) camel_digest_summary_finalize);
 	}
 	
 	return type;
@@ -77,7 +77,7 @@
 }
 
 static void
-camel_digest_summary_finalise (CamelObject *object)
+camel_digest_summary_finalize (CamelObject *object)
 {
 	
 }
@@ -86,5 +86,5 @@
 CamelFolderSummary *
 camel_digest_summary_new (void)
 {
-	return (CamelFolderSummary *) camel_object_new (camel_digest_summary_get_type ());
+	return g_object_new (CAMEL_TYPE_DIGEST_SUMMARY, NULL);
 }

Modified: branches/camel-gobject/camel/camel-disco-diary.c
==============================================================================
--- branches/camel-gobject/camel/camel-disco-diary.c	(original)
+++ branches/camel-gobject/camel/camel-disco-diary.c	Thu Apr 16 00:31:16 2009
@@ -415,7 +415,7 @@
 	g_return_val_if_fail (CAMEL_IS_DISCO_STORE (store), NULL);
 	g_return_val_if_fail (filename != NULL, NULL);
 
-	diary = CAMEL_DISCO_DIARY (camel_object_new (CAMEL_DISCO_DIARY_TYPE));
+	diary = g_object_new (CAMEL_TYPE_DISCO_DIARY, NULL);
 	diary->store = store;
 
 	d(printf("diary log file '%s'\n", filename));

Modified: branches/camel-gobject/camel/camel-filter-driver.c
==============================================================================
--- branches/camel-gobject/camel/camel-filter-driver.c	(original)
+++ branches/camel-gobject/camel/camel-filter-driver.c	Thu Apr 16 00:31:16 2009
@@ -129,7 +129,7 @@
 
 static void camel_filter_driver_class_init (CamelFilterDriverClass *klass);
 static void camel_filter_driver_init       (CamelFilterDriver *obj);
-static void camel_filter_driver_finalise   (CamelObject *obj);
+static void camel_filter_driver_finalize   (CamelObject *obj);
 
 static void camel_filter_driver_log (CamelFilterDriver *driver, enum filter_log_t status, const char *desc, ...);
 
@@ -193,7 +193,7 @@
 					    (CamelObjectClassInitFunc) camel_filter_driver_class_init,
 					    NULL,
 					    (CamelObjectInitFunc) camel_filter_driver_init,
-					    (CamelObjectFinalizeFunc) camel_filter_driver_finalise);
+					    (CamelObjectFinalizeFunc) camel_filter_driver_finalize);
 	}
 	
 	return type;
@@ -242,7 +242,7 @@
 }
 
 static void
-camel_filter_driver_finalise (CamelObject *obj)
+camel_filter_driver_finalize (CamelObject *obj)
 {
 	CamelFilterDriver *driver = (CamelFilterDriver *) obj;
 	struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);	
@@ -285,10 +285,10 @@
 CamelFilterDriver *
 camel_filter_driver_new (CamelSession *session)
 {
-	CamelFilterDriver *d = (CamelFilterDriver *)camel_object_new(camel_filter_driver_get_type());
+	CamelFilterDriver *d;
 
-	d->priv->session = session;
-	g_object_ref((CamelObject *)session);
+	d = g_object_new (CAMEL_TYPE_FILTER_DRIVER, NULL);
+	d->priv->session = g_object_ref (session);
 
 	return d;
 }

Modified: branches/camel-gobject/camel/camel-folder-search.c
==============================================================================
--- branches/camel-gobject/camel/camel-folder-search.c	(original)
+++ branches/camel-gobject/camel/camel-folder-search.c	Thu Apr 16 00:31:16 2009
@@ -241,9 +241,11 @@
 CamelFolderSearch *
 camel_folder_search_new (void)
 {
-	CamelFolderSearch *new = CAMEL_FOLDER_SEARCH (camel_object_new (camel_folder_search_get_type ()));
+	CamelFolderSearch *new;
 
+	new = g_object_new (CAMEL_TYPE_FOLDER_SEARCH, NULL);
 	camel_folder_search_construct(new);
+
 	return new;
 }
 

Modified: branches/camel-gobject/camel/camel-folder-summary.c
==============================================================================
--- branches/camel-gobject/camel/camel-folder-summary.c	(original)
+++ branches/camel-gobject/camel/camel-folder-summary.c	Thu Apr 16 00:31:16 2009
@@ -282,8 +282,9 @@
 CamelFolderSummary *
 camel_folder_summary_new (struct _CamelFolder *folder)
 {
-	CamelFolderSummary *new = CAMEL_FOLDER_SUMMARY ( camel_object_new (camel_folder_summary_get_type ()));
+	CamelFolderSummary *new;
 
+	new = g_object_new (CAMEL_TYPE_FOLDER_SUMMARY, NULL);
 	new->folder = folder;
 
 	return new;

Modified: branches/camel-gobject/camel/camel-gpg-context.c
==============================================================================
--- branches/camel-gobject/camel/camel-gpg-context.c	(original)
+++ branches/camel-gobject/camel/camel-gpg-context.c	Thu Apr 16 00:31:16 2009
@@ -90,11 +90,10 @@
 	
 	g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL);
 	
-	ctx = (CamelGpgContext *) camel_object_new (camel_gpg_context_get_type ());
+	ctx = g_object_new (CAMEL_TYPE_GPG_CONTEXT, NULL);
 	
 	cipher = (CamelCipherContext *) ctx;
-	cipher->session = session;
-	g_object_ref (session);
+	cipher->session = g_object_ref (session);
 	
 	return cipher;
 }
@@ -1930,7 +1929,7 @@
 }
 
 static void
-camel_gpg_context_finalise (CamelObject *object)
+camel_gpg_context_finalize (CamelObject *object)
 {
 	;
 }
@@ -1948,7 +1947,7 @@
 					    (CamelObjectClassInitFunc) camel_gpg_context_class_init,
 					    NULL,
 					    (CamelObjectInitFunc) camel_gpg_context_init,
-					    (CamelObjectFinalizeFunc) camel_gpg_context_finalise);
+					    (CamelObjectFinalizeFunc) camel_gpg_context_finalize);
 	}
 	
 	return type;

Modified: branches/camel-gobject/camel/camel-html-parser.c
==============================================================================
--- branches/camel-gobject/camel/camel-html-parser.c	(original)
+++ branches/camel-gobject/camel/camel-html-parser.c	Thu Apr 16 00:31:16 2009
@@ -122,8 +122,7 @@
 CamelHTMLParser *
 camel_html_parser_new (void)
 {
-	CamelHTMLParser *new = CAMEL_HTML_PARSER ( camel_object_new (camel_html_parser_get_type ()));
-	return new;
+	return g_object_new (CAMEL_TYPE_HTML_PARSER, NULL);
 }
 
 

Modified: branches/camel-gobject/camel/camel-html-parser.h
==============================================================================
--- branches/camel-gobject/camel/camel-html-parser.h	(original)
+++ branches/camel-gobject/camel/camel-html-parser.h	Thu Apr 16 00:31:16 2009
@@ -30,9 +30,24 @@
 
 #include <camel/camel-object.h>
 
-#define CAMEL_HTML_PARSER(obj)         G_TYPE_CHECK_INSTANCE_CAST (obj, camel_html_parser_get_type (), CamelHTMLParser)
-#define CAMEL_HTML_PARSER_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, camel_html_parser_get_type (), CamelHTMLParserClass)
-#define CAMEL_IS_HTML_PARSER(obj)      G_TYPE_CHECK_INSTANCE_TYPE (obj, camel_html_parser_get_type ())
+/* Standard GObject macros */
+#define CAMEL_TYPE_HTML_PARSER \
+	(camel_html_parser_get_type ())
+#define CAMEL_HTML_PARSER(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), CAMEL_TYPE_HTML_PARSER, CamelHTMLParser))
+#define CAMEL_HTML_PARSER_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), CAMEL_TYPE_HTML_PARSER, CamelHTMLParserClass))
+#define CAMEL_IS_HTML_PARSER(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), CAMEL_TYPE_HTML_PARSER))
+#define CAMEL_IS_HTML_PARSER_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), CAMEL_TYPE_HTML_PARSER))
+#define CAMEL_HTML_PARSER_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_PRIVATE \
+	((obj), CAMEL_TYPE_HTML_PARSER, CamelHTMLParserClass))
 
 G_BEGIN_DECLS
 

Modified: branches/camel-gobject/camel/camel-http-stream.c
==============================================================================
--- branches/camel-gobject/camel/camel-http-stream.c	(original)
+++ branches/camel-gobject/camel/camel-http-stream.c	Thu Apr 16 00:31:16 2009
@@ -154,7 +154,7 @@
 	g_return_val_if_fail(CAMEL_IS_SESSION(session), NULL);
 	g_return_val_if_fail(url != NULL, NULL);
 	
-	stream = CAMEL_HTTP_STREAM (camel_object_new (camel_http_stream_get_type ()));
+	stream = g_object_new (CAMEL_TYPE_HTTP_STREAM, NULL);
 	
 	stream->method = method;
 	stream->session = session;

Modified: branches/camel-gobject/camel/camel-index.c
==============================================================================
--- branches/camel-gobject/camel/camel-index.c	(original)
+++ branches/camel-gobject/camel/camel-index.c	Thu Apr 16 00:31:16 2009
@@ -70,7 +70,7 @@
 }
 
 static void
-camel_index_finalise(CamelIndex *idx)
+camel_index_finalize(CamelIndex *idx)
 {
 	g_free(idx->path);
 	g_free(idx->priv);
@@ -88,7 +88,7 @@
 					   (CamelObjectClassInitFunc) camel_index_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_index_init,
-					   (CamelObjectFinalizeFunc) camel_index_finalise);
+					   (CamelObjectFinalizeFunc) camel_index_finalize);
 	}
 	
 	return type;
@@ -97,8 +97,9 @@
 CamelIndex *
 camel_index_new(const char *path, int flags)
 {
-	CamelIndex *idx = (CamelIndex *)camel_object_new(camel_index_get_type());
+	CamelIndex *idx;
 
+	idx = g_object_new (CAMEL_TYPE_INDEX, NULL);
 	camel_index_construct(idx, path, flags);
 
 	return idx;
@@ -297,7 +298,7 @@
 }
 
 static void
-camel_index_name_finalise(CamelIndexName *idn)
+camel_index_name_finalize(CamelIndexName *idn)
 {
 	if (idn->index)
 		g_object_unref((CamelObject *)idn->index);
@@ -315,7 +316,7 @@
 					   (CamelObjectClassInitFunc) camel_index_name_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_index_name_init,
-					   (CamelObjectFinalizeFunc) camel_index_name_finalise);
+					   (CamelObjectFinalizeFunc) camel_index_name_finalize);
 	}
 	
 	return type;
@@ -324,10 +325,10 @@
 CamelIndexName *
 camel_index_name_new(CamelIndex *idx, const char *name)
 {
-	CamelIndexName *idn = (CamelIndexName *)camel_object_new(camel_index_name_get_type());
+	CamelIndexName *idn;
 
-	idn->index = idx;
-	g_object_ref((CamelObject *)idx);
+	idn = g_object_new (CAMEL_TYPE_INDEX_NAME, NULL);
+	idn->index = g_object_ref (idx);
 
 	return idn;
 }
@@ -372,7 +373,7 @@
 }
 
 static void
-camel_index_cursor_finalise(CamelIndexCursor *idc)
+camel_index_cursor_finalize(CamelIndexCursor *idc)
 {
 	if (idc->index)
 		g_object_unref((CamelObject *)idc->index);
@@ -390,7 +391,7 @@
 					   (CamelObjectClassInitFunc) camel_index_cursor_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_index_cursor_init,
-					   (CamelObjectFinalizeFunc) camel_index_cursor_finalise);
+					   (CamelObjectFinalizeFunc) camel_index_cursor_finalize);
 	}
 	
 	return type;
@@ -399,10 +400,10 @@
 CamelIndexCursor *
 camel_index_cursor_new(CamelIndex *idx, const char *name)
 {
-	CamelIndexCursor *idc = (CamelIndexCursor *)camel_object_new(camel_index_cursor_get_type());
+	CamelIndexCursor *idc;
 
-	idc->index = idx;
-	g_object_ref((CamelObject *)idx);
+	idc = g_object_new (CAMEL_TYPE_INDEX_CURSOR, NULL);
+	idc->index = g_object_ref (idx);
 
 	return idc;
 }

Modified: branches/camel-gobject/camel/camel-internet-address.c
==============================================================================
--- branches/camel-gobject/camel/camel-internet-address.c	(original)
+++ branches/camel-gobject/camel/camel-internet-address.c	Thu Apr 16 00:31:16 2009
@@ -279,8 +279,7 @@
 CamelInternetAddress *
 camel_internet_address_new (void)
 {
-	CamelInternetAddress *new = CAMEL_INTERNET_ADDRESS(camel_object_new(camel_internet_address_get_type()));
-	return new;
+	return g_object_new (CAMEL_TYPE_INTERNET_ADDRESS, NULL);
 }
 
 

Modified: branches/camel-gobject/camel/camel-medium.c
==============================================================================
--- branches/camel-gobject/camel/camel-medium.c	(original)
+++ branches/camel-gobject/camel/camel-medium.c	Thu Apr 16 00:31:16 2009
@@ -101,7 +101,7 @@
 	static GType camel_medium_type = G_TYPE_INVALID;
 
 	if (camel_medium_type == G_TYPE_INVALID) {
-		camel_medium_type = camel_type_register (CAMEL_DATA_WRAPPER_TYPE, "medium",
+		camel_medium_type = camel_type_register (CAMEL_TYPE_DATA_WRAPPER, "medium",
 							 sizeof (CamelMedium),
 							 sizeof (CamelMediumClass),
 							 (CamelObjectClassInitFunc) camel_medium_class_init,

Modified: branches/camel-gobject/camel/camel-mime-filter-basic.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-basic.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-basic.c	Thu Apr 16 00:31:16 2009
@@ -264,8 +264,7 @@
 CamelMimeFilterBasic *
 camel_mime_filter_basic_new (void)
 {
-	CamelMimeFilterBasic *new = CAMEL_MIME_FILTER_BASIC ( camel_object_new (camel_mime_filter_basic_get_type ()));
-	return new;
+	return g_object_new (CAMEL_TYPE_MIME_FILTER_BASIC, NULL);
 }
 
 

Modified: branches/camel-gobject/camel/camel-mime-filter-bestenc.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-bestenc.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-bestenc.c	Thu Apr 16 00:31:16 2009
@@ -204,8 +204,11 @@
 CamelMimeFilterBestenc *
 camel_mime_filter_bestenc_new (unsigned int flags)
 {
-	CamelMimeFilterBestenc *new = (CamelMimeFilterBestenc *)camel_object_new(camel_mime_filter_bestenc_get_type());
+	CamelMimeFilterBestenc *new;
+
+	new = g_object_new (CAMEL_TYPE_MIME_FILTER_BESTENC, NULL);
 	new->flags = flags;
+
 	return new;
 }
 

Modified: branches/camel-gobject/camel/camel-mime-filter-canon.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-canon.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-canon.c	Thu Apr 16 00:31:16 2009
@@ -191,9 +191,10 @@
 CamelMimeFilter *
 camel_mime_filter_canon_new(guint32 flags)
 {
-	CamelMimeFilterCanon *chomp = CAMEL_MIME_FILTER_CANON (camel_object_new (CAMEL_MIME_FILTER_CANON_TYPE));
+	CamelMimeFilterCanon *chomp;
 
+	chomp = g_object_new (CAMEL_TYPE_MIME_FILTER_CANON, NULL);
 	chomp->flags = flags;
 
-	return (CamelMimeFilter *) chomp;
+	return CAMEL_MIME_FILTER (chomp);
 }

Modified: branches/camel-gobject/camel/camel-mime-filter-charset.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-charset.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-charset.c	Thu Apr 16 00:31:16 2009
@@ -251,7 +251,7 @@
 CamelMimeFilterCharset *
 camel_mime_filter_charset_new (void)
 {
-	return CAMEL_MIME_FILTER_CHARSET (camel_object_new (camel_mime_filter_charset_get_type ()));
+	return g_object_new (CAMEL_TYPE_MIME_FILTER_CHARSET, NULL);
 }
 
 
@@ -270,8 +270,7 @@
 {
 	CamelMimeFilterCharset *new;
 	
-	new = CAMEL_MIME_FILTER_CHARSET (camel_object_new (camel_mime_filter_charset_get_type ()));
-	
+	new = camel_mime_filter_charset_new ();
 	new->ic = camel_iconv_open (to_charset, from_charset);
 	if (new->ic == (iconv_t) -1) {
 		w(g_warning ("Cannot create charset conversion from %s to %s: %s",

Modified: branches/camel-gobject/camel/camel-mime-filter-crlf.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-crlf.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-crlf.c	Thu Apr 16 00:31:16 2009
@@ -174,13 +174,14 @@
 CamelMimeFilter *
 camel_mime_filter_crlf_new (CamelMimeFilterCRLFDirection direction, CamelMimeFilterCRLFMode mode)
 {
-	CamelMimeFilterCRLF *crlf = CAMEL_MIME_FILTER_CRLF(camel_object_new (CAMEL_MIME_FILTER_CRLF_TYPE));
+	CamelMimeFilterCRLF *crlf;
 	
+	crlf = g_object_new (CAMEL_TYPE_MIME_FILTER_CRLF, NULL);
 	crlf->direction = direction;
 	crlf->mode = mode;
 	crlf->saw_cr = FALSE;
 	crlf->saw_lf = TRUE;
 	crlf->saw_dot = FALSE;
 	
-	return (CamelMimeFilter *)crlf;
+	return CAMEL_MIME_FILTER (crlf);
 }

Modified: branches/camel-gobject/camel/camel-mime-filter-enriched.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-enriched.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-enriched.c	Thu Apr 16 00:31:16 2009
@@ -577,7 +577,7 @@
 {
 	CamelMimeFilterEnriched *new;
 	
-	new = (CamelMimeFilterEnriched *) camel_object_new (CAMEL_TYPE_MIME_FILTER_ENRICHED);
+	new = g_object_new (CAMEL_TYPE_MIME_FILTER_ENRICHED, NULL);
 	new->flags = flags;
 	
 	return CAMEL_MIME_FILTER (new);

Modified: branches/camel-gobject/camel/camel-mime-filter-from.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-from.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-from.c	Thu Apr 16 00:31:16 2009
@@ -180,8 +180,7 @@
 CamelMimeFilterFrom *
 camel_mime_filter_from_new (void)
 {
-	CamelMimeFilterFrom *new = CAMEL_MIME_FILTER_FROM ( camel_object_new (camel_mime_filter_from_get_type ()));
-	return new;
+	return g_object_new (CAMEL_TYPE_MIME_FILTER_FROM, NULL);
 }
 
 #if 0

Modified: branches/camel-gobject/camel/camel-mime-filter-gzip.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-gzip.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-gzip.c	Thu Apr 16 00:31:16 2009
@@ -448,7 +448,7 @@
 	CamelMimeFilterGZip *new;
 	int retval;
 	
-	new = (CamelMimeFilterGZip *) camel_object_new (CAMEL_TYPE_MIME_FILTER_GZIP);
+	new = g_object_new (CAMEL_TYPE_MIME_FILTER_GZIP, NULL);
 	new->mode = mode;
 	new->level = level;
 	
@@ -462,5 +462,5 @@
 		return NULL;
 	}
 	
-	return (CamelMimeFilter *) new;
+	return CAMEL_MIME_FILTER (new);
 }

Modified: branches/camel-gobject/camel/camel-mime-filter-html.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-html.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-html.c	Thu Apr 16 00:31:16 2009
@@ -195,6 +195,5 @@
 CamelMimeFilterHTML *
 camel_mime_filter_html_new (void)
 {
-	CamelMimeFilterHTML *new = CAMEL_MIME_FILTER_HTML ( camel_object_new (camel_mime_filter_html_get_type ()));
-	return new;
+	return g_object_new (CAMEL_TYPE_MIME_FILTER_HTML, NULL);
 }

Modified: branches/camel-gobject/camel/camel-mime-filter-index.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-index.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-index.c	Thu Apr 16 00:31:16 2009
@@ -111,8 +111,7 @@
 CamelMimeFilterIndex *
 camel_mime_filter_index_new (void)
 {
-	CamelMimeFilterIndex *new = CAMEL_MIME_FILTER_INDEX ( camel_object_new (camel_mime_filter_index_get_type ()));
-	return new;
+	return g_object_new (CAMEL_TYPE_MIME_FILTER_INDEX, NULL);
 }
 
 

Modified: branches/camel-gobject/camel/camel-mime-filter-linewrap.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-linewrap.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-linewrap.c	Thu Apr 16 00:31:16 2009
@@ -132,13 +132,13 @@
 CamelMimeFilter *
 camel_mime_filter_linewrap_new (guint preferred_len, guint max_len, char indent_char)
 {
-	CamelMimeFilterLinewrap *linewrap =
-		CAMEL_MIME_FILTER_LINEWRAP (camel_object_new (CAMEL_MIME_FILTER_LINEWRAP_TYPE));
+	CamelMimeFilterLinewrap *linewrap;
 	
+	linewrap = g_object_new (CAMEL_TYPE_MIME_FILTER_LINEWRAP, NULL);
 	linewrap->indent = indent_char;
 	linewrap->wrap_len = preferred_len;
 	linewrap->max_len = max_len;
 	linewrap->nchars = 0;
 	
-	return (CamelMimeFilter *) linewrap;
+	return CAMEL_MIME_FILTER (linewrap);
 }

Modified: branches/camel-gobject/camel/camel-mime-filter-pgp.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-pgp.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-pgp.c	Thu Apr 16 00:31:16 2009
@@ -188,5 +188,5 @@
 CamelMimeFilter *
 camel_mime_filter_pgp_new(void)
 {
-	return (CamelMimeFilter *) camel_object_new (camel_mime_filter_pgp_get_type ());
+	return g_object_new (CAMEL_TYPE_MIME_FILTER_PGP, NULL);
 }

Modified: branches/camel-gobject/camel/camel-mime-filter-progress.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-progress.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-progress.c	Thu Apr 16 00:31:16 2009
@@ -134,11 +134,11 @@
 CamelMimeFilter *
 camel_mime_filter_progress_new (CamelOperation *operation, size_t total)
 {
-	CamelMimeFilter *filter;
+	CamelMimeFilterProgress *filter;
 	
-	filter = (CamelMimeFilter *) camel_object_new (camel_mime_filter_progress_get_type ());
-	((CamelMimeFilterProgress *) filter)->operation = operation;
-	((CamelMimeFilterProgress *) filter)->total = total;
+	filter = g_object_new (CAMEL_TYPE_MIME_FILTER_PROGRESS, NULL);
+	filter->operation = operation;
+	filter->total = total;
 	
-	return filter;
+	return CAMEL_MIME_FILTER (filter);
 }

Modified: branches/camel-gobject/camel/camel-mime-filter-save.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-save.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-save.c	Thu Apr 16 00:31:16 2009
@@ -104,11 +104,12 @@
 CamelMimeFilter *
 camel_mime_filter_save_new (void)
 {
-	CamelMimeFilterSave *save = CAMEL_MIME_FILTER_SAVE (camel_object_new (CAMEL_MIME_FILTER_SAVE_TYPE));
+	CamelMimeFilterSave *save;
 	
+	save = g_object_new (CAMEL_TYPE_MIME_FILTER_SAVE);
 	save->stream = camel_stream_mem_new ();
 	
-	return (CamelMimeFilter *) save;
+	return CAMEL_MIME_FILTER (save);
 }
 
 
@@ -124,9 +125,10 @@
 CamelMimeFilter *
 camel_mime_filter_save_new_with_stream (CamelStream *stream)
 {
-	CamelMimeFilterSave *save = CAMEL_MIME_FILTER_SAVE (camel_object_new (CAMEL_MIME_FILTER_SAVE_TYPE));
+	CamelMimeFilterSave *save;
 	
-	save->stream = stream;
+	save = g_object_new (CAMEL_TYPE_MIME_FILTER_SAVE, NULL);
+	save->stream = g_object_ref (stream);
 	g_object_ref (stream);
 	
 	return (CamelMimeFilter *) save;

Modified: branches/camel-gobject/camel/camel-mime-filter-tohtml.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-tohtml.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-tohtml.c	Thu Apr 16 00:31:16 2009
@@ -437,8 +437,7 @@
 	CamelMimeFilterToHTML *new;
 	int i;
 	
-	new = CAMEL_MIME_FILTER_TOHTML (camel_object_new (camel_mime_filter_tohtml_get_type ()));
-	
+	new = g_object_new (CAMEL_TYPE_MIME_FILTER_TOHTML, NULL);
 	new->flags = flags;
 	new->colour = colour;
 	

Modified: branches/camel-gobject/camel/camel-mime-filter-windows.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-windows.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-windows.c	Thu Apr 16 00:31:16 2009
@@ -150,8 +150,7 @@
 	
 	g_return_val_if_fail (claimed_charset != NULL, NULL);
 	
-	new = CAMEL_MIME_FILTER_WINDOWS (camel_object_new (camel_mime_filter_windows_get_type ()));
-	
+	new = g_object_new (CAMEL_TYPE_MIME_FILTER_WINDOWS, NULL);
 	new->claimed_charset = g_strdup (claimed_charset);
 	
 	return CAMEL_MIME_FILTER (new);

Modified: branches/camel-gobject/camel/camel-mime-filter-yenc.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter-yenc.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter-yenc.c	Thu Apr 16 00:31:16 2009
@@ -244,7 +244,7 @@
 {
 	CamelMimeFilterYenc *new;
 	
-	new = (CamelMimeFilterYenc *) camel_object_new (CAMEL_TYPE_MIME_FILTER_YENC);
+	new = g_object_new (CAMEL_TYPE_MIME_FILTER_YENC, NULL);
 	new->direction = direction;
 	
 	switch (direction) {
@@ -258,7 +258,7 @@
 		g_assert_not_reached ();
 	}
 	
-	return (CamelMimeFilter *) new;
+	return CAMEL_MIME_FILTER (new);
 }
 
 

Modified: branches/camel-gobject/camel/camel-mime-filter.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-filter.c	(original)
+++ branches/camel-gobject/camel/camel-mime-filter.c	Thu Apr 16 00:31:16 2009
@@ -114,8 +114,7 @@
 CamelMimeFilter *
 camel_mime_filter_new (void)
 {
-	CamelMimeFilter *new = CAMEL_MIME_FILTER ( camel_object_new (camel_mime_filter_get_type ()));
-	return new;
+	return g_object_new (CAMEL_TYPE_MIME_FILTER, NULL);
 }
 
 #ifdef MALLOC_CHECK

Modified: branches/camel-gobject/camel/camel-mime-message.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-message.c	(original)
+++ branches/camel-gobject/camel/camel-mime-message.c	Thu Apr 16 00:31:16 2009
@@ -200,10 +200,7 @@
 CamelMimeMessage *
 camel_mime_message_new (void) 
 {
-	CamelMimeMessage *mime_message;
-	mime_message = CAMEL_MIME_MESSAGE (camel_object_new (CAMEL_MIME_MESSAGE_TYPE));
-	
-	return mime_message;
+	return g_object_new (CAMEL_TYPE_MIME_MESSAGE, NULL);
 }
 
 /* **** Date: */

Modified: branches/camel-gobject/camel/camel-mime-parser.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-parser.c	(original)
+++ branches/camel-gobject/camel/camel-mime-parser.c	Thu Apr 16 00:31:16 2009
@@ -206,7 +206,7 @@
 }
 
 static void
-camel_mime_parser_finalise(CamelObject *o)
+camel_mime_parser_finalize(CamelObject *o)
 {
 	struct _header_scan_state *s = _PRIVATE(o);
 #ifdef PURIFY
@@ -227,7 +227,7 @@
 					    (CamelObjectClassInitFunc) camel_mime_parser_class_init,
 					    NULL,
 					    (CamelObjectInitFunc) camel_mime_parser_init,
-					    (CamelObjectFinalizeFunc) camel_mime_parser_finalise);
+					    (CamelObjectFinalizeFunc) camel_mime_parser_finalize);
 	}
 	
 	return type;
@@ -243,8 +243,7 @@
 CamelMimeParser *
 camel_mime_parser_new (void)
 {
-	CamelMimeParser *new = CAMEL_MIME_PARSER ( camel_object_new (camel_mime_parser_get_type ()));
-	return new;
+	return g_object_new (CAMEL_TYPE_MIME_PARSER, NULL);
 }
 
 

Modified: branches/camel-gobject/camel/camel-mime-part.c
==============================================================================
--- branches/camel-gobject/camel/camel-mime-part.c	(original)
+++ branches/camel-gobject/camel/camel-mime-part.c	Thu Apr 16 00:31:16 2009
@@ -1025,7 +1025,7 @@
 CamelMimePart *
 camel_mime_part_new (void)
 {
-	return (CamelMimePart *)camel_object_new (CAMEL_MIME_PART_TYPE);
+	return g_object_new (CAMEL_TYPE_MIME_PART, NULL);
 }
 
 /**

Modified: branches/camel-gobject/camel/camel-multipart-encrypted.c
==============================================================================
--- branches/camel-gobject/camel/camel-multipart-encrypted.c	(original)
+++ branches/camel-gobject/camel/camel-multipart-encrypted.c	Thu Apr 16 00:31:16 2009
@@ -132,9 +132,5 @@
 CamelMultipartEncrypted *
 camel_multipart_encrypted_new (void)
 {
-	CamelMultipartEncrypted *multipart;
-	
-	multipart = (CamelMultipartEncrypted *) camel_object_new (CAMEL_MULTIPART_ENCRYPTED_TYPE);
-	
-	return multipart;
+	return g_object_new (CAMEL_TYPE_MULTIPART_ENCRYPTED, NULL);
 }

Modified: branches/camel-gobject/camel/camel-multipart-signed.c
==============================================================================
--- branches/camel-gobject/camel/camel-multipart-signed.c	(original)
+++ branches/camel-gobject/camel/camel-multipart-signed.c	Thu Apr 16 00:31:16 2009
@@ -173,11 +173,7 @@
 CamelMultipartSigned *
 camel_multipart_signed_new (void)
 {
-	CamelMultipartSigned *multipart;
-
-	multipart = (CamelMultipartSigned *)camel_object_new(CAMEL_MULTIPART_SIGNED_TYPE);
-
-	return multipart;
+	return g_object_new (CAMEL_TYPE_MULTIPART_SIGNED_TYPE, NULL);
 }
 
 static int

Modified: branches/camel-gobject/camel/camel-multipart.c
==============================================================================
--- branches/camel-gobject/camel/camel-multipart.c	(original)
+++ branches/camel-gobject/camel/camel-multipart.c	Thu Apr 16 00:31:16 2009
@@ -158,7 +158,7 @@
 {
 	CamelMultipart *multipart;
 
-	multipart = (CamelMultipart *)camel_object_new (CAMEL_MULTIPART_TYPE);
+	multipart = g_object_new (CAMEL_TYPE_MULTIPART, NULL);
 	multipart->preface = NULL;
 	multipart->postface = NULL;
 

Modified: branches/camel-gobject/camel/camel-news-address.c
==============================================================================
--- branches/camel-gobject/camel/camel-news-address.c	(original)
+++ branches/camel-gobject/camel/camel-news-address.c	Thu Apr 16 00:31:16 2009
@@ -60,6 +60,5 @@
 CamelNewsAddress *
 camel_news_address_new (void)
 {
-	CamelNewsAddress *new = CAMEL_NEWS_ADDRESS ( camel_object_new (camel_news_address_get_type ()));
-	return new;
+	return g_object_new (CAMEL_TYPE_NEWS_ADDRESS, NULL);
 }

Modified: branches/camel-gobject/camel/camel-nntp-address.c
==============================================================================
--- branches/camel-gobject/camel/camel-nntp-address.c	(original)
+++ branches/camel-gobject/camel/camel-nntp-address.c	Thu Apr 16 00:31:16 2009
@@ -155,8 +155,7 @@
 CamelNNTPAddress *
 camel_nntp_address_new (void)
 {
-	CamelNNTPAddress *new = CAMEL_NNTP_ADDRESS(camel_object_new(camel_nntp_address_get_type()));
-	return new;
+	return g_object_new (CAMEL_TYPE_NNTP_ADDRESS, NULL);
 }
 
 /**

Modified: branches/camel-gobject/camel/camel-partition-table.c
==============================================================================
--- branches/camel-gobject/camel/camel-partition-table.c	(original)
+++ branches/camel-gobject/camel/camel-partition-table.c	Thu Apr 16 00:31:16 2009
@@ -70,7 +70,7 @@
 }
 
 static void
-camel_partition_table_finalise(CamelPartitionTable *cpi)
+camel_partition_table_finalize(CamelPartitionTable *cpi)
 {
 	CamelBlock *bl;
 	struct _CamelPartitionTablePrivate *p;
@@ -105,7 +105,7 @@
 					   (CamelObjectClassInitFunc) camel_partition_table_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_partition_table_init,
-					   (CamelObjectFinalizeFunc) camel_partition_table_finalise);
+					   (CamelObjectFinalizeFunc) camel_partition_table_finalize);
 	}
 	
 	return type;
@@ -196,7 +196,7 @@
 	CamelPartitionKeyBlock *kb;
 	CamelBlock *block, *pblock;
 
-	cpi = (CamelPartitionTable *)camel_object_new(camel_partition_table_get_type());
+	cpi = g_object_new (CAMEL_TYPE_PARTITION_TABLE, NULL);
 	cpi->rootid = root;
 	cpi->blocks = bs;
 	g_object_ref((CamelObject *)bs);
@@ -611,7 +611,7 @@
 }
 
 static void
-camel_key_table_finalise(CamelKeyTable *ki)
+camel_key_table_finalize(CamelKeyTable *ki)
 {
 	struct _CamelKeyTablePrivate *p;
 
@@ -644,7 +644,7 @@
 					   (CamelObjectClassInitFunc) camel_key_table_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_key_table_init,
-					   (CamelObjectFinalizeFunc) camel_key_table_finalise);
+					   (CamelObjectFinalizeFunc) camel_key_table_finalize);
 	}
 	
 	return type;
@@ -656,7 +656,7 @@
 {
 	CamelKeyTable *ki;
 
-	ki = (CamelKeyTable *)camel_object_new(camel_key_table_get_type());
+	ki = g_object_new (CAMEL_TYPE_KEY_TABLE, NULL);
 
 	ki->blocks = bs;
 	g_object_ref((CamelObject *)bs);

Modified: branches/camel-gobject/camel/camel-sasl-anonymous.c
==============================================================================
--- branches/camel-gobject/camel/camel-sasl-anonymous.c	(original)
+++ branches/camel-gobject/camel/camel-sasl-anonymous.c	Thu Apr 16 00:31:16 2009
@@ -103,9 +103,10 @@
 {
 	CamelSaslAnonymous *sasl_anon;
 	
-	if (!trace_info && type != CAMEL_SASL_ANON_TRACE_EMPTY) return NULL;
+	if (!trace_info && type != CAMEL_SASL_ANON_TRACE_EMPTY)
+		return NULL;
 	
-	sasl_anon = CAMEL_SASL_ANONYMOUS (camel_object_new (camel_sasl_anonymous_get_type ()));
+	sasl_anon = g_object_new (CAMEL_TYPE_SASL_ANONYMOUS, NULL);
 	sasl_anon->trace_info = g_strdup (trace_info);
 	sasl_anon->type = type;
 	

Modified: branches/camel-gobject/camel/camel-sasl.c
==============================================================================
--- branches/camel-gobject/camel/camel-sasl.c	(original)
+++ branches/camel-gobject/camel/camel-sasl.c	Thu Apr 16 00:31:16 2009
@@ -190,6 +190,7 @@
 camel_sasl_new (const char *service_name, const char *mechanism, CamelService *service)
 {
 	CamelSasl *sasl;
+	GType type;
 	
 	g_return_val_if_fail (service_name != NULL, NULL);
 	g_return_val_if_fail (mechanism != NULL, NULL);
@@ -198,28 +199,29 @@
 	/* We don't do ANONYMOUS here, because it's a little bit weird. */
 	
 	if (!strcmp (mechanism, "CRAM-MD5"))
-		sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_CRAM_MD5_TYPE);
+		type = CAMEL_TYPE_SASL_CRAM_MD5;
 	else if (!strcmp (mechanism, "DIGEST-MD5"))
-		sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_DIGEST_MD5_TYPE);
+		type = CAMEL_TYPE_SASL_DIGEST_MD5;
 #ifdef HAVE_KRB5
 	else if (!strcmp (mechanism, "GSSAPI"))
-		sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_GSSAPI_TYPE);
+		type = CAMEL_TYPE_SASL_GSSAPI;
 #endif
 #ifdef HAVE_KRB4
 	else if (!strcmp (mechanism, "KERBEROS_V4"))
-		sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_KERBEROS4_TYPE);
+		type = CAMEL_TYPE_SASL_KERBEROS4;
 #endif
 	else if (!strcmp (mechanism, "PLAIN"))
-		sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_PLAIN_TYPE);
+		type = CAMEL_TYPE_SASL_PLAIN;
 	else if (!strcmp (mechanism, "LOGIN"))
-		sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_LOGIN_TYPE);
+		type = CAMEL_TYPE_SASL_LOGIN;
 	else if (!strcmp (mechanism, "POPB4SMTP"))
-		sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_POPB4SMTP_TYPE);
+		type = CAMEL_TYPE_SASL_POPB4SMTP;
 	else if (!strcmp (mechanism, "NTLM"))
-		sasl = (CamelSasl *) camel_object_new (CAMEL_SASL_NTLM_TYPE);
+		type = CAMEL_TYPE_SASL_NTLM;
 	else
 		return NULL;
 
+	sasl = g_object_new (type, NULL);
 	sasl->mech = g_strdup (mechanism);
 	sasl->service_name = g_strdup (service_name);
 	sasl->service = service;

Modified: branches/camel-gobject/camel/camel-seekable-substream.c
==============================================================================
--- branches/camel-gobject/camel/camel-seekable-substream.c	(original)
+++ branches/camel-gobject/camel/camel-seekable-substream.c	Thu Apr 16 00:31:16 2009
@@ -117,7 +117,7 @@
 	g_return_val_if_fail (CAMEL_IS_SEEKABLE_STREAM (parent_stream), NULL);
 
 	/* Create the seekable substream. */
-	seekable_substream = CAMEL_SEEKABLE_SUBSTREAM (camel_object_new (camel_seekable_substream_get_type ()));
+	seekable_substream = g_object_new (CAMEL_TYPE_SEEKABLE_SUBSTREAM, NULL);
 
 	/* Initialize it. */
 	seekable_substream->parent_stream = parent_stream;

Modified: branches/camel-gobject/camel/camel-session.c
==============================================================================
--- branches/camel-gobject/camel/camel-session.c	(original)
+++ branches/camel-gobject/camel/camel-session.c	Thu Apr 16 00:31:16 2009
@@ -83,7 +83,7 @@
 }
 
 static void
-camel_session_finalise (CamelObject *o)
+camel_session_finalize (CamelObject *o)
 {
 	CamelSession *session = (CamelSession *)o;
 	GThreadPool *thread_pool = session->priv->thread_pool;
@@ -136,7 +136,7 @@
 			(CamelObjectClassInitFunc) camel_session_class_init,
 			NULL,
 			(CamelObjectInitFunc) camel_session_init,
-			(CamelObjectFinalizeFunc) camel_session_finalise);
+			(CamelObjectFinalizeFunc) camel_session_finalize);
 	}
 
 	return camel_session_type;
@@ -193,7 +193,7 @@
 	/* Now look up the service in the provider's cache */
 	service = camel_object_bag_reserve(provider->service_cache[type], url);
 	if (service == NULL) {
-		service = (CamelService *)camel_object_new (provider->object_types[type]);
+		service = g_object_new (provider->object_types[type], NULL);
 		camel_exception_init (&internal_ex);
 		camel_service_construct (service, session, provider, url, &internal_ex);
 		if (camel_exception_is_set (&internal_ex)) {

Modified: branches/camel-gobject/camel/camel-smime-context.c
==============================================================================
--- branches/camel-gobject/camel/camel-smime-context.c	(original)
+++ branches/camel-gobject/camel/camel-smime-context.c	Thu Apr 16 00:31:16 2009
@@ -102,11 +102,10 @@
 	
 	g_return_val_if_fail(CAMEL_IS_SESSION(session), NULL);
 	
-	ctx =(CamelSMIMEContext *) camel_object_new(camel_smime_context_get_type());
+	ctx = g_object_new (CAMEL_TYPE_SMIME_CONTEXT, NULL);
 	
 	cipher =(CamelCipherContext *) ctx;
-	cipher->session = session;
-	g_object_ref(session);
+	cipher->session = g_object_ref (session);
 	
 	return cipher;
 }
@@ -1028,7 +1027,7 @@
 }
 
 static void
-camel_smime_context_finalise(CamelObject *object)
+camel_smime_context_finalize(CamelObject *object)
 {
 	CamelSMIMEContext *context = (CamelSMIMEContext *)object;
 
@@ -1050,7 +1049,7 @@
 					   (CamelObjectClassInitFunc) camel_smime_context_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_smime_context_init,
-					   (CamelObjectFinalizeFunc) camel_smime_context_finalise);
+					   (CamelObjectFinalizeFunc) camel_smime_context_finalize);
 	}
 	
 	return type;

Modified: branches/camel-gobject/camel/camel-store-summary.c
==============================================================================
--- branches/camel-gobject/camel/camel-store-summary.c	(original)
+++ branches/camel-gobject/camel/camel-store-summary.c	Thu Apr 16 00:31:16 2009
@@ -67,7 +67,7 @@
 
 static void camel_store_summary_class_init (CamelStoreSummaryClass *klass);
 static void camel_store_summary_init       (CamelStoreSummary *obj);
-static void camel_store_summary_finalise   (CamelObject *obj);
+static void camel_store_summary_finalize   (CamelObject *obj);
 
 static CamelObjectClass *camel_store_summary_parent;
 
@@ -114,7 +114,7 @@
 }
 
 static void
-camel_store_summary_finalise (CamelObject *obj)
+camel_store_summary_finalize (CamelObject *obj)
 {
 	struct _CamelStoreSummaryPrivate *p;
 	CamelStoreSummary *s = (CamelStoreSummary *)obj;
@@ -150,7 +150,7 @@
 					    (CamelObjectClassInitFunc) camel_store_summary_class_init,
 					    NULL,
 					    (CamelObjectInitFunc) camel_store_summary_init,
-					    (CamelObjectFinalizeFunc) camel_store_summary_finalise);
+					    (CamelObjectFinalizeFunc) camel_store_summary_finalize);
 	}
 	
 	return type;
@@ -167,7 +167,7 @@
 CamelStoreSummary *
 camel_store_summary_new (void)
 {
-	CamelStoreSummary *new = CAMEL_STORE_SUMMARY ( camel_object_new (camel_store_summary_get_type ()));	return new;
+	return g_object_new (CAMEL_TYPE_STORE_SUMMARY, NULL);
 }
 
 

Modified: branches/camel-gobject/camel/camel-stream-buffer.c
==============================================================================
--- branches/camel-gobject/camel/camel-stream-buffer.c	(original)
+++ branches/camel-gobject/camel/camel-stream-buffer.c	Thu Apr 16 00:31:16 2009
@@ -175,7 +175,7 @@
 {
 	CamelStreamBuffer *sbf;
 
-	sbf = CAMEL_STREAM_BUFFER (camel_object_new (camel_stream_buffer_get_type ()));
+	sbf = g_object_new (CAMEL_TYPE_STREAM_BUFFER, NULL);
 	CAMEL_STREAM_BUFFER_CLASS (CAMEL_OBJECT_GET_CLASS(sbf))->init (sbf, stream, mode);
 
 	return CAMEL_STREAM (sbf);
@@ -220,7 +220,8 @@
 camel_stream_buffer_new_with_vbuf (CamelStream *stream, CamelStreamBufferMode mode, char *buf, guint32 size)
 {
 	CamelStreamBuffer *sbf;
-	sbf = CAMEL_STREAM_BUFFER (camel_object_new (camel_stream_buffer_get_type ()));
+
+	sbf = g_object_new (CAMEL_TYPE_STREAM_BUFFER, NULL);
 	CAMEL_STREAM_BUFFER_CLASS (CAMEL_OBJECT_GET_CLASS(sbf))->init_vbuf (sbf, stream, mode, buf, size);
 
 	return CAMEL_STREAM (sbf);

Modified: branches/camel-gobject/camel/camel-stream-filter.c
==============================================================================
--- branches/camel-gobject/camel/camel-stream-filter.c	(original)
+++ branches/camel-gobject/camel/camel-stream-filter.c	Thu Apr 16 00:31:16 2009
@@ -147,10 +147,10 @@
 CamelStreamFilter *
 camel_stream_filter_new_with_stream(CamelStream *stream)
 {
-	CamelStreamFilter *new = CAMEL_STREAM_FILTER ( camel_object_new (camel_stream_filter_get_type ()));
+	CamelStreamFilter *new;
 
-	new->source = stream;
-	g_object_ref ((CamelObject *)stream);
+	new = g_object_new (CAMEL_TYPE_STREAM_FILTER, NULL);
+	new->source = g_object_ref (stream);
 
 	return new;
 }

Modified: branches/camel-gobject/camel/camel-stream-fs.c
==============================================================================
--- branches/camel-gobject/camel/camel-stream-fs.c	(original)
+++ branches/camel-gobject/camel/camel-stream-fs.c	Thu Apr 16 00:31:16 2009
@@ -127,7 +127,7 @@
 	if (fd == -1)
 		return NULL;
 
-	stream_fs = CAMEL_STREAM_FS (camel_object_new (camel_stream_fs_get_type ()));
+	stream_fs = g_object_new (CAMEL_TYPE_STREAM_FS, NULL);
 	stream_fs->fd = fd;
 	offset = lseek (fd, 0, SEEK_CUR);
 	if (offset == -1)

Modified: branches/camel-gobject/camel/camel-stream-mem.c
==============================================================================
--- branches/camel-gobject/camel/camel-stream-mem.c	(original)
+++ branches/camel-gobject/camel/camel-stream-mem.c	Thu Apr 16 00:31:16 2009
@@ -165,7 +165,7 @@
 {
 	CamelStreamMem *stream_mem;
 
-	stream_mem = CAMEL_STREAM_MEM (camel_object_new (CAMEL_STREAM_MEM_TYPE));
+	stream_mem = g_object_new (CAMEL_TYPE_STREAM_MEM, NULL);
 	stream_mem->buffer = buffer;
 	stream_mem->owner = TRUE;
 
@@ -178,7 +178,7 @@
  * @mem: a #CamelStreamMem object
  * 
  * Mark the memory stream as secure.  At the very least this means the
- * data in the buffer will be cleared when the buffer is finalised.
+ * data in the buffer will be cleared when the buffer is finalized.
  * This only applies to buffers owned by the stream.
  **/
 void

Modified: branches/camel-gobject/camel/camel-stream-null.c
==============================================================================
--- branches/camel-gobject/camel/camel-stream-null.c	(original)
+++ branches/camel-gobject/camel/camel-stream-null.c	Thu Apr 16 00:31:16 2009
@@ -87,5 +87,5 @@
 CamelStream *
 camel_stream_null_new(void)
 {
-	return (CamelStream *)camel_object_new(camel_stream_null_get_type ());
+	return g_object_new (CAMEL_TYPE_STREAM_NULL, NULL);
 }

Modified: branches/camel-gobject/camel/camel-stream-process.c
==============================================================================
--- branches/camel-gobject/camel/camel-stream-process.c	(original)
+++ branches/camel-gobject/camel/camel-stream-process.c	Thu Apr 16 00:31:16 2009
@@ -56,7 +56,7 @@
 static int       stream_flush      (CamelStream *stream);
 
 static void
-camel_stream_process_finalise (CamelObject *object)
+camel_stream_process_finalize (CamelObject *object)
 {
 	/* Ensure we clean up after ourselves -- kill
 	   the child process and reap it. */
@@ -100,7 +100,7 @@
 					     (CamelObjectClassInitFunc) camel_stream_process_class_init,
 					     NULL,
 					     (CamelObjectInitFunc) camel_stream_process_init,
-					     (CamelObjectFinalizeFunc) camel_stream_process_finalise);
+					     (CamelObjectFinalizeFunc) camel_stream_process_finalize);
 	}
 	
 	return type;
@@ -116,7 +116,7 @@
 CamelStream *
 camel_stream_process_new (void)
 {
-	return (CamelStream *) camel_object_new (camel_stream_process_get_type ());
+	return g_object_new (CAMEL_TYPE_STREAM_PROCESS, NULL);
 }
 
 

Modified: branches/camel-gobject/camel/camel-stream-vfs.c
==============================================================================
--- branches/camel-gobject/camel/camel-stream-vfs.c	(original)
+++ branches/camel-gobject/camel/camel-stream-vfs.c	Thu Apr 16 00:31:16 2009
@@ -120,7 +120,7 @@
 	g_return_val_if_fail (G_IS_OUTPUT_STREAM (stream) || G_IS_INPUT_STREAM (stream), NULL);
 
 	errno = 0;
-	stream_vfs = CAMEL_STREAM_VFS (camel_object_new (camel_stream_vfs_get_type ()));
+	stream_vfs = g_object_new (CAMEL_TYPE_STREAM_VFS, NULL);
 	stream_vfs->stream = stream;
 
 	return CAMEL_STREAM (stream_vfs);

Modified: branches/camel-gobject/camel/camel-tcp-stream-openssl.c
==============================================================================
--- branches/camel-gobject/camel/camel-tcp-stream-openssl.c	(original)
+++ branches/camel-gobject/camel/camel-tcp-stream-openssl.c	Thu Apr 16 00:31:16 2009
@@ -175,8 +175,8 @@
 {
 	CamelTcpStreamSSL *stream;
 	
-	stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
-	
+	stream = g_object_new (CAMEL_TYPE_TCP_STREAM_SSL, NULL);
+
 	stream->priv->service = service;
 	stream->priv->expected_host = g_strdup (expected_host);
 	stream->priv->ssl_mode = TRUE;
@@ -203,7 +203,7 @@
 {
 	CamelTcpStreamSSL *stream;
 	
-	stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
+	stream = g_object_new (CAMEL_TYPE_TCP_STREAM_SSL, NULL);
 	
 	stream->priv->service = service;
 	stream->priv->expected_host = g_strdup (expected_host);

Modified: branches/camel-gobject/camel/camel-tcp-stream-raw.c
==============================================================================
--- branches/camel-gobject/camel/camel-tcp-stream-raw.c	(original)
+++ branches/camel-gobject/camel/camel-tcp-stream-raw.c	Thu Apr 16 00:31:16 2009
@@ -237,11 +237,7 @@
 CamelStream *
 camel_tcp_stream_raw_new (void)
 {
-	CamelTcpStreamRaw *stream;
-	
-	stream = CAMEL_TCP_STREAM_RAW (camel_object_new (camel_tcp_stream_raw_get_type ()));
-	
-	return CAMEL_STREAM (stream);
+	return g_object_new (CAMEL_TYPE_TCP_STREAM_RAW, NULL);
 }
 
 static ssize_t

Modified: branches/camel-gobject/camel/camel-tcp-stream-ssl.c
==============================================================================
--- branches/camel-gobject/camel/camel-tcp-stream-ssl.c	(original)
+++ branches/camel-gobject/camel/camel-tcp-stream-ssl.c	Thu Apr 16 00:31:16 2009
@@ -186,10 +186,9 @@
 
 	g_assert(CAMEL_IS_SESSION(session));
 
-	stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
+	stream = g_object_new (CAMEL_TYPE_TCP_STREAM_SSL, NULL);
 	
-	stream->priv->session = session;
-	g_object_ref(session);
+	stream->priv->session = g_object_ref (session);
 	stream->priv->expected_host = g_strdup (expected_host);
 	stream->priv->ssl_mode = TRUE;
 	stream->priv->flags = flags;
@@ -220,10 +219,9 @@
 
 	g_assert(CAMEL_IS_SESSION(session));
 	
-	stream = CAMEL_TCP_STREAM_SSL (camel_object_new (camel_tcp_stream_ssl_get_type ()));
+	stream = g_object_new (CAMEL_TYPE_TCP_STREAM_SSL, NULL);
 	
-	stream->priv->session = session;
-	g_object_ref(session);
+	stream->priv->session = g_object_ref (session);
 	stream->priv->expected_host = g_strdup (expected_host);
 	stream->priv->ssl_mode = FALSE;
 	stream->priv->flags = flags;

Modified: branches/camel-gobject/camel/camel-text-index.c
==============================================================================
--- branches/camel-gobject/camel/camel-text-index.c	(original)
+++ branches/camel-gobject/camel/camel-text-index.c	Thu Apr 16 00:31:16 2009
@@ -768,7 +768,7 @@
 }
 
 static void
-camel_text_index_finalise(CamelTextIndex *idx)
+camel_text_index_finalize(CamelTextIndex *idx)
 {
 	struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
 
@@ -810,7 +810,7 @@
 					   (CamelObjectClassInitFunc) camel_text_index_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_text_index_init,
-					   (CamelObjectFinalizeFunc) camel_text_index_finalise);
+					   (CamelObjectFinalizeFunc) camel_text_index_finalize);
 	}
 	
 	return type;
@@ -831,7 +831,7 @@
 CamelTextIndex *
 camel_text_index_new(const char *path, int flags)
 {
-	CamelTextIndex *idx = (CamelTextIndex *)camel_object_new(camel_text_index_get_type());
+	CamelTextIndex *idx = g_object_new (CAMEL_TYPE_TEXT_INDEX, NULL);
 	struct _CamelTextIndexPrivate *p = CTI_PRIVATE(idx);
 	struct _CamelTextIndexRoot *rb;
 	char *link;
@@ -1526,7 +1526,7 @@
 }
 
 static void
-camel_text_index_name_finalise(CamelTextIndexName *idn)
+camel_text_index_name_finalize(CamelTextIndexName *idn)
 {
 	CamelTextIndexNamePrivate *p = CIN_PRIVATE(idn);
 	
@@ -1550,7 +1550,7 @@
 					   (CamelObjectClassInitFunc) camel_text_index_name_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_text_index_name_init,
-					   (CamelObjectFinalizeFunc) camel_text_index_name_finalise);
+					   (CamelObjectFinalizeFunc) camel_text_index_name_finalize);
 	}
 	
 	return type;
@@ -1559,7 +1559,7 @@
 CamelTextIndexName *
 camel_text_index_name_new(CamelTextIndex *idx, const char *name, camel_key_t nameid)
 {
-	CamelTextIndexName *idn = (CamelTextIndexName *)camel_object_new(camel_text_index_name_get_type());
+	CamelTextIndexName *idn = g_object_new (CAMEL_TYPE_TEXT_INDEX_NAME, NULL);
 	CamelIndexName *cin = &idn->parent;
 	CamelTextIndexNamePrivate *p = CIN_PRIVATE(idn);
 
@@ -1645,7 +1645,7 @@
 }
 
 static void
-camel_text_index_cursor_finalise(CamelTextIndexCursor *idc)
+camel_text_index_cursor_finalize(CamelTextIndexCursor *idc)
 {
 	struct _CamelTextIndexCursorPrivate *p = CIC_PRIVATE(idc);
 
@@ -1666,7 +1666,7 @@
 					   (CamelObjectClassInitFunc) camel_text_index_cursor_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_text_index_cursor_init,
-					   (CamelObjectFinalizeFunc) camel_text_index_cursor_finalise);
+					   (CamelObjectFinalizeFunc) camel_text_index_cursor_finalize);
 	}
 	
 	return type;
@@ -1675,7 +1675,7 @@
 CamelTextIndexCursor *
 camel_text_index_cursor_new(CamelTextIndex *idx, camel_block_t data)
 {
-	CamelTextIndexCursor *idc = (CamelTextIndexCursor *)camel_object_new(camel_text_index_cursor_get_type());
+	CamelTextIndexCursor *idc = g_object_new (CAMEL_TYPE_TEXT_INDEX_CURSOR, NULL);
 	CamelIndexCursor *cic = &idc->parent;
 	struct _CamelTextIndexCursorPrivate *p = CIC_PRIVATE(idc);
 
@@ -1756,7 +1756,7 @@
 }
 
 static void
-camel_text_index_key_cursor_finalise(CamelTextIndexKeyCursor *idc)
+camel_text_index_key_cursor_finalize(CamelTextIndexKeyCursor *idc)
 {
 	struct _CamelTextIndexKeyCursorPrivate *p = CIKC_PRIVATE(idc);
 
@@ -1778,7 +1778,7 @@
 					   (CamelObjectClassInitFunc) camel_text_index_key_cursor_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_text_index_key_cursor_init,
-					   (CamelObjectFinalizeFunc) camel_text_index_key_cursor_finalise);
+					   (CamelObjectFinalizeFunc) camel_text_index_key_cursor_finalize);
 	}
 	
 	return type;
@@ -1787,7 +1787,7 @@
 CamelTextIndexKeyCursor *
 camel_text_index_key_cursor_new(CamelTextIndex *idx, CamelKeyTable *table)
 {
-	CamelTextIndexKeyCursor *idc = (CamelTextIndexKeyCursor *)camel_object_new(camel_text_index_key_cursor_get_type());
+	CamelTextIndexKeyCursor *idc = g_object_new (CAMEL_TYPE_TEXT_INDEX_KEY_CURSOR, NULL);
 	CamelIndexCursor *cic = &idc->parent;
 	struct _CamelTextIndexKeyCursorPrivate *p = CIKC_PRIVATE(idc);
 

Modified: branches/camel-gobject/camel/camel-vee-folder.c
==============================================================================
--- branches/camel-gobject/camel/camel-vee-folder.c	(original)
+++ branches/camel-gobject/camel/camel-vee-folder.c	Thu Apr 16 00:31:16 2009
@@ -74,7 +74,7 @@
 
 static void camel_vee_folder_class_init (CamelVeeFolderClass *klass);
 static void camel_vee_folder_init       (CamelVeeFolder *obj);
-static void camel_vee_folder_finalise   (CamelObject *obj);
+static void camel_vee_folder_finalize   (CamelObject *obj);
 
 static int vee_rebuild_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException *ex);
 static void vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source);
@@ -100,7 +100,7 @@
 					    (CamelObjectClassInitFunc) camel_vee_folder_class_init,
 					    NULL,
 					    (CamelObjectInitFunc) camel_vee_folder_init,
-					    (CamelObjectFinalizeFunc) camel_vee_folder_finalise);
+					    (CamelObjectFinalizeFunc) camel_vee_folder_finalize);
 	}
 	
 	return type;
@@ -146,7 +146,7 @@
 			name = full;
 		else
 			name++;
-		vf = (CamelVeeFolder *)camel_object_new(camel_vee_folder_get_type());
+		vf = g_object_new (CAMEL_TYPE_VEE_FOLDER, NULL);
 		camel_vee_folder_construct(vf, parent_store, full, name, flags);
 	}
 
@@ -2356,7 +2356,7 @@
 }
 
 static void
-camel_vee_folder_finalise (CamelObject *obj)
+camel_vee_folder_finalize (CamelObject *obj)
 {
 	CamelVeeFolder *vf = (CamelVeeFolder *)obj;
 	struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);

Modified: branches/camel-gobject/camel/camel-vee-store.c
==============================================================================
--- branches/camel-gobject/camel/camel-vee-store.c	(original)
+++ branches/camel-gobject/camel/camel-vee-store.c	Thu Apr 16 00:31:16 2009
@@ -47,7 +47,7 @@
 
 static void camel_vee_store_class_init (CamelVeeStoreClass *klass);
 static void camel_vee_store_init       (CamelVeeStore *obj);
-static void camel_vee_store_finalise   (CamelObject *obj);
+static void camel_vee_store_finalize   (CamelObject *obj);
 static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex);
 
 static CamelStoreClass *camel_vee_store_parent;
@@ -64,7 +64,7 @@
 					    (CamelObjectClassInitFunc) camel_vee_store_class_init,
 					    NULL,
 					    (CamelObjectInitFunc) camel_vee_store_init,
-					    (CamelObjectFinalizeFunc) camel_vee_store_finalise);
+					    (CamelObjectFinalizeFunc) camel_vee_store_finalize);
 	}
 	
 	return type;
@@ -110,7 +110,7 @@
 	/* Set up unmatched folder */
 #ifdef VEE_UNMATCHED_ENABLE
 	obj->unmatched_uids = g_hash_table_new (g_str_hash, g_str_equal);
-	obj->folder_unmatched = (CamelVeeFolder *)camel_object_new (camel_vee_folder_get_type ());
+	obj->folder_unmatched = g_object_new (CAMEL_TYPE_VEE_FOLDER, NULL);
 	camel_vee_folder_construct (obj->folder_unmatched, store, CAMEL_UNMATCHED_NAME, _("Unmatched"), CAMEL_STORE_FOLDER_PRIVATE);
 	camel_db_create_vfolder (store->cdb, _("Unmatched"), NULL);
 #endif
@@ -123,7 +123,7 @@
 }
 
 static void
-camel_vee_store_finalise (CamelObject *obj)
+camel_vee_store_finalize (CamelObject *obj)
 {
 	CamelVeeStore *vstore = (CamelVeeStore *)obj;
 
@@ -142,8 +142,7 @@
 CamelVeeStore *
 camel_vee_store_new (void)
 {
-	CamelVeeStore *new = CAMEL_VEE_STORE(camel_object_new(camel_vee_store_get_type ()));
-	return new;
+	return g_object_new (CAMEL_TYPE_VEE_STORE, NULL);
 }
 
 /* flags

Modified: branches/camel-gobject/camel/camel-vee-summary.c
==============================================================================
--- branches/camel-gobject/camel/camel-vee-summary.c	(original)
+++ branches/camel-gobject/camel/camel-vee-summary.c	Thu Apr 16 00:31:16 2009
@@ -396,7 +396,7 @@
 {
 	CamelVeeSummary *s;
 
-	s = (CamelVeeSummary *)camel_object_new(camel_vee_summary_get_type());
+	s = g_object_new (CAMEL_TYPE_VEE_SUMMARY, NULL);
 	s->summary.folder = parent;
 	s->force_counts = FALSE;
 	s->fake_visible_count = 0;

Modified: branches/camel-gobject/camel/camel-vtrash-folder.c
==============================================================================
--- branches/camel-gobject/camel/camel-vtrash-folder.c	(original)
+++ branches/camel-gobject/camel/camel-vtrash-folder.c	Thu Apr 16 00:31:16 2009
@@ -103,7 +103,7 @@
 	
 	g_assert(type < CAMEL_VTRASH_FOLDER_LAST);
 
-	vtrash = (CamelVTrashFolder *)camel_object_new(camel_vtrash_folder_get_type());
+	vtrash = g_object_new (CAMEL_TYPE_VTRASH_FOLDER, NULL);
 	camel_vee_folder_construct(CAMEL_VEE_FOLDER (vtrash), parent_store, vdata[type].full_name, _(vdata[type].name),
 				   CAMEL_STORE_FOLDER_PRIVATE|CAMEL_STORE_FOLDER_CREATE|CAMEL_STORE_VEE_FOLDER_AUTO|CAMEL_STORE_VEE_FOLDER_SPECIAL);
 

Modified: branches/camel-gobject/camel/providers/groupwise/camel-groupwise-folder.c
==============================================================================
--- branches/camel-gobject/camel/providers/groupwise/camel-groupwise-folder.c	(original)
+++ branches/camel-gobject/camel/providers/groupwise/camel-groupwise-folder.c	Thu Apr 16 00:31:16 2009
@@ -825,7 +825,7 @@
 	char *short_name;
 
 
-	folder = CAMEL_FOLDER (camel_object_new(camel_groupwise_folder_get_type ()) );
+	folder = g_object_new (CAMEL_TYPE_GROUPWISE_FOLDER, NULL);
 
 	gw_folder = CAMEL_GROUPWISE_FOLDER(folder);
 	short_name = strrchr (folder_name, '/');

Modified: branches/camel-gobject/camel/providers/groupwise/camel-groupwise-journal.c
==============================================================================
--- branches/camel-gobject/camel/providers/groupwise/camel-groupwise-journal.c	(original)
+++ branches/camel-gobject/camel/providers/groupwise/camel-groupwise-journal.c	Thu Apr 16 00:31:16 2009
@@ -326,7 +326,7 @@
 	
 	g_return_val_if_fail (CAMEL_IS_GROUPWISE_FOLDER (folder), NULL);
 	
-	journal = (CamelOfflineJournal *) camel_object_new (camel_groupwise_journal_get_type ());
+	journal = g_object_new (CAMEL_TYPE_OFFLINE_JOURNAL, NULL);
 	camel_offline_journal_construct (journal, (CamelFolder *) folder, filename);
 	
 	return journal;

Modified: branches/camel-gobject/camel/providers/groupwise/camel-groupwise-store-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/groupwise/camel-groupwise-store-summary.c	(original)
+++ branches/camel-gobject/camel/providers/groupwise/camel-groupwise-store-summary.c	Thu Apr 16 00:31:16 2009
@@ -57,7 +57,7 @@
 
 static void camel_groupwise_store_summary_class_init (CamelGroupwiseStoreSummaryClass *klass);
 static void camel_groupwise_store_summary_init       (CamelGroupwiseStoreSummary *obj);
-static void camel_groupwise_store_summary_finalise   (CamelObject *obj);
+static void camel_groupwise_store_summary_finalize   (CamelObject *obj);
 
 static CamelStoreSummaryClass *camel_groupwise_store_summary_parent;
 
@@ -90,7 +90,7 @@
 
 
 static void
-camel_groupwise_store_summary_finalise (CamelObject *obj)
+camel_groupwise_store_summary_finalize (CamelObject *obj)
 {
 }
 
@@ -108,7 +108,7 @@
 				(CamelObjectClassInitFunc) camel_groupwise_store_summary_class_init,
 				NULL,
 				(CamelObjectInitFunc) camel_groupwise_store_summary_init,
-				(CamelObjectFinalizeFunc) camel_groupwise_store_summary_finalise);
+				(CamelObjectFinalizeFunc) camel_groupwise_store_summary_finalize);
 	}
 
 	return type;
@@ -118,9 +118,7 @@
 CamelGroupwiseStoreSummary *
 camel_groupwise_store_summary_new (void)
 {
-	CamelGroupwiseStoreSummary *new = CAMEL_GW_STORE_SUMMARY ( camel_object_new (camel_groupwise_store_summary_get_type ()));
-
-	return new;
+	return g_object_new (CAMEL_TYPE_GW_STORE_SUMMARY, NULL);
 }
 
 

Modified: branches/camel-gobject/camel/providers/groupwise/camel-groupwise-store.c
==============================================================================
--- branches/camel-gobject/camel/providers/groupwise/camel-groupwise-store.c	(original)
+++ branches/camel-gobject/camel/providers/groupwise/camel-groupwise-store.c	Thu Apr 16 00:31:16 2009
@@ -1482,7 +1482,7 @@
 	return n == 0 && (p == '%' || p == 0);
 }
 
-/* GObject Init and finalise methods */
+/* GObject Init and finalize methods */
 static void
 camel_groupwise_store_class_init (CamelGroupwiseStoreClass *camel_groupwise_store_class)
 {

Modified: branches/camel-gobject/camel/providers/groupwise/camel-groupwise-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/groupwise/camel-groupwise-summary.c	(original)
+++ branches/camel-gobject/camel/providers/groupwise/camel-groupwise-summary.c	Thu Apr 16 00:31:16 2009
@@ -162,9 +162,9 @@
 camel_groupwise_summary_new (struct _CamelFolder *folder, const char *filename)
 {
 	CamelException ex;
-	CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (
-			camel_object_new (camel_groupwise_summary_get_type ()));
+	CamelFolderSummary *summary;
 	
+	summary = g_object_new (CAMEL_TYPE_GW_SUMMARY, NULL);
 	summary->folder = folder ;
 	camel_folder_summary_set_build_content (summary, TRUE);
 	camel_folder_summary_set_filename (summary, filename);

Modified: branches/camel-gobject/camel/providers/imap/camel-imap-folder.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap/camel-imap-folder.c	(original)
+++ branches/camel-gobject/camel/providers/imap/camel-imap-folder.c	Thu Apr 16 00:31:16 2009
@@ -234,7 +234,7 @@
 		return NULL;
 	}
 
-	folder = CAMEL_FOLDER (camel_object_new (camel_imap_folder_get_type ()));
+	folder = g_object_type (CAMEL_TYPE_IMAP_FOLDER, NULL);
 	short_name = strrchr (folder_name, '/');
 	if (short_name)
 		short_name++;

Modified: branches/camel-gobject/camel/providers/imap/camel-imap-journal.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap/camel-imap-journal.c	(original)
+++ branches/camel-gobject/camel/providers/imap/camel-imap-journal.c	Thu Apr 16 00:31:16 2009
@@ -406,7 +406,7 @@
 	g_return_val_if_fail (CAMEL_IS_IMAP_FOLDER (folder), NULL);
 
 	d(g_print ("Creating the journal \n"));
-	journal = (CamelOfflineJournal *) camel_object_new (camel_imap_journal_get_type ());
+	journal = g_object_new (CAMEL_TYPE_IMAP_JOURNAL, NULL);
 	camel_offline_journal_construct (journal, (CamelFolder *) folder, filename);
 	
 	return journal;

Modified: branches/camel-gobject/camel/providers/imap/camel-imap-message-cache.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap/camel-imap-message-cache.c	(original)
+++ branches/camel-gobject/camel/providers/imap/camel-imap-message-cache.c	Thu Apr 16 00:31:16 2009
@@ -164,7 +164,7 @@
 		return NULL;
 	}
 
-	cache = (CamelImapMessageCache *)camel_object_new (CAMEL_IMAP_MESSAGE_CACHE_TYPE);
+	cache = g_object_new (CAMEL_TYPE_IMAP_MESSAGE_CACHE, NULL);
 	cache->path = g_strdup (path);
 
 	cache->parts = g_hash_table_new (g_str_hash, g_str_equal);

Modified: branches/camel-gobject/camel/providers/imap/camel-imap-search.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap/camel-imap-search.c	(original)
+++ branches/camel-gobject/camel/providers/imap/camel-imap-search.c	Thu Apr 16 00:31:16 2009
@@ -122,7 +122,7 @@
 }
 
 static void
-camel_imap_search_finalise(CamelImapSearch *is)
+camel_imap_search_finalize(CamelImapSearch *is)
 {
 	struct _match_record *mr;
 
@@ -145,7 +145,7 @@
 			sizeof (CamelImapSearchClass),
 			(CamelObjectClassInitFunc) camel_imap_search_class_init, NULL,
 			(CamelObjectInitFunc) camel_imap_search_init,
-			(CamelObjectFinalizeFunc) camel_imap_search_finalise);
+			(CamelObjectFinalizeFunc) camel_imap_search_finalize);
 	}
 
 	return camel_imap_search_type;
@@ -159,7 +159,7 @@
 CamelFolderSearch *
 camel_imap_search_new (const char *cachedir)
 {
-	CamelFolderSearch *new = CAMEL_FOLDER_SEARCH (camel_object_new (camel_imap_search_get_type ()));
+	CamelFolderSearch *new = g_object_new (CAMEL_TYPE_IMAP_SEARCH, NULL);
 	CamelImapSearch *is = (CamelImapSearch *)new;
 
 	camel_folder_search_construct (new);

Modified: branches/camel-gobject/camel/providers/imap/camel-imap-store-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap/camel-imap-store-summary.c	(original)
+++ branches/camel-gobject/camel/providers/imap/camel-imap-store-summary.c	Thu Apr 16 00:31:16 2009
@@ -60,7 +60,7 @@
 
 static void camel_imap_store_summary_class_init (CamelImapStoreSummaryClass *klass);
 static void camel_imap_store_summary_init       (CamelImapStoreSummary *obj);
-static void camel_imap_store_summary_finalise   (CamelObject *obj);
+static void camel_imap_store_summary_finalize   (CamelObject *obj);
 
 static CamelStoreSummaryClass *camel_imap_store_summary_parent;
 
@@ -95,7 +95,7 @@
 }
 
 static void
-camel_imap_store_summary_finalise (CamelObject *obj)
+camel_imap_store_summary_finalize (CamelObject *obj)
 {
 	/*struct _CamelImapStoreSummaryPrivate *p;*/
 	/*CamelImapStoreSummary *s = (CamelImapStoreSummary *)obj;*/
@@ -116,7 +116,7 @@
 					   (CamelObjectClassInitFunc) camel_imap_store_summary_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_imap_store_summary_init,
-					   (CamelObjectFinalizeFunc) camel_imap_store_summary_finalise);
+					   (CamelObjectFinalizeFunc) camel_imap_store_summary_finalize);
 	}
 	
 	return type;
@@ -132,9 +132,7 @@
 CamelImapStoreSummary *
 camel_imap_store_summary_new (void)
 {
-	CamelImapStoreSummary *new = CAMEL_IMAP_STORE_SUMMARY ( camel_object_new (camel_imap_store_summary_get_type ()));
-
-	return new;
+	return g_object_new (CAMEL_TYPE_IMAP_STORE_SUMMARY, NULL);
 }
 
 /**

Modified: branches/camel-gobject/camel/providers/imap/camel-imap-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap/camel-imap-summary.c	(original)
+++ branches/camel-gobject/camel/providers/imap/camel-imap-summary.c	Thu Apr 16 00:31:16 2009
@@ -192,10 +192,11 @@
 CamelFolderSummary *
 camel_imap_summary_new (struct _CamelFolder *folder, const char *filename)
 {
-	CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY (camel_object_new (camel_imap_summary_get_type ()));
+	CamelFolderSummary *summary;
 	CamelException ex;
 	camel_exception_init (&ex);
 
+	summary = g_object_new (CAMEL_TYPE_IMAP_SUMMARY, NULL);
 	summary->folder = folder;
 	/* Don't do DB sort. Its pretty slow to load */
 	if (folder && 0) {

Modified: branches/camel-gobject/camel/providers/imap/camel-imap-wrapper.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap/camel-imap-wrapper.c	(original)
+++ branches/camel-gobject/camel/providers/imap/camel-imap-wrapper.c	Thu Apr 16 00:31:16 2009
@@ -98,7 +98,7 @@
 
 	if (type == G_TYPE_INVALID) {
 		type = camel_type_register (
-			CAMEL_DATA_WRAPPER_TYPE,
+			CAMEL_TYPE_DATA_WRAPPER,
 			"CamelImapWrapper",
 			sizeof (CamelImapWrapper),
 			sizeof (CamelImapWrapperClass),
@@ -171,7 +171,7 @@
 	CamelImapWrapper *imap_wrapper;
 	CamelStream *stream;
 
-	imap_wrapper = (CamelImapWrapper *)camel_object_new(camel_imap_wrapper_get_type());
+	imap_wrapper = g_object_new (CAMEL_TYPE_IMAP_WRAPPER, NULL);
 
 	camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (imap_wrapper), type);
 	((CamelDataWrapper *)imap_wrapper)->offline = TRUE;

Modified: branches/camel-gobject/camel/providers/imap4/camel-imap4-engine.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap4/camel-imap4-engine.c	(original)
+++ branches/camel-gobject/camel/providers/imap4/camel-imap4-engine.c	Thu Apr 16 00:31:16 2009
@@ -164,7 +164,7 @@
 	
 	g_return_val_if_fail (CAMEL_IS_SERVICE (service), NULL);
 	
-	engine = (CamelIMAP4Engine *) camel_object_new (CAMEL_TYPE_IMAP4_ENGINE);
+	engine = g_object_new (CAMEL_TYPE_IMAP4_ENGINE, NULL);
 	engine->session = service->session;
 	engine->url = service->url;
 	engine->service = service;

Modified: branches/camel-gobject/camel/providers/imap4/camel-imap4-folder.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap4/camel-imap4-folder.c	(original)
+++ branches/camel-gobject/camel/providers/imap4/camel-imap4-folder.c	Thu Apr 16 00:31:16 2009
@@ -364,7 +364,7 @@
 	
 	utf7_name = camel_utf8_utf7 (utf7_name);
 	
-	folder = (CamelFolder *) (imap4_folder = (CamelIMAP4Folder *) camel_object_new (CAMEL_TYPE_IMAP4_FOLDER));
+	folder = g_object_new (CAMEL_TYPE_IMAP4_FOLDER, NULL);
 	camel_folder_construct (folder, store, full_name, name);
 	imap4_folder->utf7_name = utf7_name;
 	

Modified: branches/camel-gobject/camel/providers/imap4/camel-imap4-journal.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap4/camel-imap4-journal.c	(original)
+++ branches/camel-gobject/camel/providers/imap4/camel-imap4-journal.c	Thu Apr 16 00:31:16 2009
@@ -281,7 +281,7 @@
 	
 	g_return_val_if_fail (CAMEL_IS_IMAP4_FOLDER (folder), NULL);
 	
-	journal = (CamelOfflineJournal *) camel_object_new (camel_imap4_journal_get_type ());
+	journal = g_object_new (CAMEL_TYPE_IMAP4_JOURNAL, NULL);
 	camel_offline_journal_construct (journal, (CamelFolder *) folder, filename);
 	
 	return journal;

Modified: branches/camel-gobject/camel/providers/imap4/camel-imap4-search.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap4/camel-imap4-search.c	(original)
+++ branches/camel-gobject/camel/providers/imap4/camel-imap4-search.c	Thu Apr 16 00:31:16 2009
@@ -93,7 +93,7 @@
 {
 	CamelIMAP4Search *search;
 	
-	search = (CamelIMAP4Search *) camel_object_new (camel_imap4_search_get_type ());
+	search = g_object_new (CAMEL_TYPE_IMAP4_SEARCH, NULL);
 	camel_folder_search_construct ((CamelFolderSearch *) search);
 	search->engine = engine;
 	

Modified: branches/camel-gobject/camel/providers/imap4/camel-imap4-store-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap4/camel-imap4-store-summary.c	(original)
+++ branches/camel-gobject/camel/providers/imap4/camel-imap4-store-summary.c	Thu Apr 16 00:31:16 2009
@@ -286,7 +286,7 @@
 CamelIMAP4StoreSummary *
 camel_imap4_store_summary_new (void)
 {
-	return (CamelIMAP4StoreSummary *) camel_object_new (camel_imap4_store_summary_get_type ());
+	return g_object_new (CAMEL_TYPE_IMAP4_STORE_SUMMARY, NULL);
 }
 
 

Modified: branches/camel-gobject/camel/providers/imap4/camel-imap4-stream.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap4/camel-imap4-stream.c	(original)
+++ branches/camel-gobject/camel/providers/imap4/camel-imap4-stream.c	Thu Apr 16 00:31:16 2009
@@ -282,9 +282,8 @@
 	
 	g_return_val_if_fail (CAMEL_IS_STREAM (stream), NULL);
 	
-	imap4 = (CamelIMAP4Stream *) camel_object_new (CAMEL_TYPE_IMAP4_STREAM);
-	g_object_ref (stream);
-	imap4->stream = stream;
+	imap4 = g_object_new (CAMEL_TYPE_IMAP4_STREAM, NULL);
+	imap4->stream = g_object_ref (stream);
 	
 	return (CamelStream *) imap4;
 }

Modified: branches/camel-gobject/camel/providers/imap4/camel-imap4-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/imap4/camel-imap4-summary.c	(original)
+++ branches/camel-gobject/camel/providers/imap4/camel-imap4-summary.c	Thu Apr 16 00:31:16 2009
@@ -138,7 +138,7 @@
 {
 	CamelFolderSummary *summary;
 	
-	summary = (CamelFolderSummary *) camel_object_new (CAMEL_TYPE_IMAP4_SUMMARY);
+	summary = g_object_new (CAMEL_TYPE_IMAP4_SUMMARY, NULL);
 	summary->folder = folder;
 	
 	return summary;

Modified: branches/camel-gobject/camel/providers/imapp/camel-imapp-driver.c
==============================================================================
--- branches/camel-gobject/camel/providers/imapp/camel-imapp-driver.c	(original)
+++ branches/camel-gobject/camel/providers/imapp/camel-imapp-driver.c	Thu Apr 16 00:31:16 2009
@@ -47,7 +47,7 @@
 }
 
 static void
-object_finalise(CamelIMAPPDriver *ie, CamelIMAPPDriverClass *ieclass)
+object_finalize(CamelIMAPPDriver *ie, CamelIMAPPDriverClass *ieclass)
 {
 	if (ie->folder)
 		g_object_unref((CamelObject *)ie->folder);
@@ -71,7 +71,7 @@
 			(CamelObjectClassInitFunc) class_init,
 			NULL,
 			(CamelObjectInitFunc) object_init,
-			(CamelObjectFinalizeFunc) object_finalise);
+			(CamelObjectFinalizeFunc) object_finalize);
 	}
 	
 	return type;
@@ -83,7 +83,7 @@
 	CamelIMAPPDriver *driver;
 	CamelIMAPPEngine *ie;
 
-	driver = CAMEL_IMAPP_DRIVER (camel_object_new (CAMEL_IMAPP_DRIVER_TYPE));
+	driver = g_object_new (CAMEL_TYPE_IMAPP_DRIVER, NULL);
 	ie = driver->engine = camel_imapp_engine_new(stream);
 	
 	camel_imapp_engine_add_handler(ie, "FETCH", (CamelIMAPPEngineFunc)driver_resp_fetch, driver);

Modified: branches/camel-gobject/camel/providers/imapp/camel-imapp-engine.c
==============================================================================
--- branches/camel-gobject/camel/providers/imapp/camel-imapp-engine.c	(original)
+++ branches/camel-gobject/camel/providers/imapp/camel-imapp-engine.c	Thu Apr 16 00:31:16 2009
@@ -62,7 +62,7 @@
 }
 
 static void
-object_finalise(CamelIMAPPEngine *ie, CamelIMAPPEngineClass *ieclass)
+object_finalize(CamelIMAPPEngine *ie, CamelIMAPPEngineClass *ieclass)
 {
 	/* FIXME: need to free the commands ... */
 	while (camel_imapp_engine_iterate(ie, NULL) > 0)
@@ -86,7 +86,7 @@
 			(CamelObjectClassInitFunc) class_init,
 			NULL,
 			(CamelObjectInitFunc) object_init,
-			(CamelObjectFinalizeFunc) object_finalise);
+			(CamelObjectFinalizeFunc) object_finalize);
 	}
 	
 	return type;
@@ -220,9 +220,8 @@
 {
 	CamelIMAPPEngine * volatile engine;
 
-	engine = CAMEL_IMAPP_ENGINE (camel_object_new (CAMEL_IMAPP_ENGINE_TYPE));
-	engine->stream = stream;
-	g_object_ref((CamelObject *)stream);
+	engine = g_object_new (CAMEL_TYPE_IMAPP_ENGINE, NULL);
+	engine->stream = g_object_ref (stream);
 
 	camel_imapp_engine_add_handler(engine, "CAPABILITY", resp_capability, engine);
 

Modified: branches/camel-gobject/camel/providers/imapp/camel-imapp-fetch-stream.c
==============================================================================
--- branches/camel-gobject/camel/providers/imapp/camel-imapp-fetch-stream.c	(original)
+++ branches/camel-gobject/camel/providers/imapp/camel-imapp-fetch-stream.c	Thu Apr 16 00:31:16 2009
@@ -135,7 +135,7 @@
 }
 
 static void
-camel_imapp_fetch_stream_finalise(CamelIMAPPFetchStream *is)
+camel_imapp_fetch_stream_finalize(CamelIMAPPFetchStream *is)
 {
 	if (is->engine)
 		g_object_unref(is->engine);
@@ -155,7 +155,7 @@
 							    (CamelObjectClassInitFunc) camel_imapp_fetch_stream_class_init,
 							    NULL,
 							    (CamelObjectInitFunc) camel_imapp_fetch_stream_init,
-							    (CamelObjectFinalizeFunc) camel_imapp_fetch_stream_finalise );
+							    (CamelObjectFinalizeFunc) camel_imapp_fetch_stream_finalize );
 	}
 
 	return camel_imapp_fetch_stream_type;
@@ -171,9 +171,8 @@
 {
 	CamelIMAPPFetchStream *is;
 
-	is = (CamelIMAPPFetchStream *)camel_object_new(camel_imapp_fetch_stream_get_type ());
-	is->engine = ie;
-	g_object_ref(ie);
+	is = g_object_new (CAMEL_TYPE_IMAPP_FETCH_STREAM, NULL);
+	is->engine = g_object_ref (ie);
 
 	is->command = camel_imapp_engine_command_new(ie, "FETCH", NULL, "FETCH %t (BODY[%t]<0.4096>", uid, body);
 	camel_imapp_engine_command_queue(ie, command);

Modified: branches/camel-gobject/camel/providers/imapp/camel-imapp-folder.c
==============================================================================
--- branches/camel-gobject/camel/providers/imapp/camel-imapp-folder.c	(original)
+++ branches/camel-gobject/camel/providers/imapp/camel-imapp-folder.c	Thu Apr 16 00:31:16 2009
@@ -121,7 +121,7 @@
 
 	d(printf("opening imap folder '%s'\n", path));
 	
-	folder = CAMEL_FOLDER (camel_object_new (CAMEL_IMAPP_FOLDER_TYPE));
+	folder = g_object_new (CAMEL_TYPE_IMAPP_FOLDER, NULL);
 	camel_folder_construct(folder, store, path, path);
 
 	((CamelIMAPPFolder *)folder)->raw_name = g_strdup(path);

Modified: branches/camel-gobject/camel/providers/imapp/camel-imapp-store-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/imapp/camel-imapp-store-summary.c	(original)
+++ branches/camel-gobject/camel/providers/imapp/camel-imapp-store-summary.c	Thu Apr 16 00:31:16 2009
@@ -57,7 +57,7 @@
 
 static void camel_imapp_store_summary_class_init (CamelIMAPPStoreSummaryClass *klass);
 static void camel_imapp_store_summary_init       (CamelIMAPPStoreSummary *obj);
-static void camel_imapp_store_summary_finalise   (CamelObject *obj);
+static void camel_imapp_store_summary_finalize   (CamelObject *obj);
 
 static CamelStoreSummaryClass *camel_imapp_store_summary_parent;
 
@@ -90,7 +90,7 @@
 }
 
 static void
-camel_imapp_store_summary_finalise (CamelObject *obj)
+camel_imapp_store_summary_finalize (CamelObject *obj)
 {
 	/*struct _CamelIMAPPStoreSummaryPrivate *p;*/
 	/*CamelIMAPPStoreSummary *s = (CamelIMAPPStoreSummary *)obj;*/
@@ -112,7 +112,7 @@
 					   (CamelObjectClassInitFunc) camel_imapp_store_summary_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_imapp_store_summary_init,
-					   (CamelObjectFinalizeFunc) camel_imapp_store_summary_finalise);
+					   (CamelObjectFinalizeFunc) camel_imapp_store_summary_finalize);
 	}
 	
 	return type;
@@ -128,9 +128,7 @@
 CamelIMAPPStoreSummary *
 camel_imapp_store_summary_new (void)
 {
-	CamelIMAPPStoreSummary *new = CAMEL_IMAPP_STORE_SUMMARY ( camel_object_new (camel_imapp_store_summary_get_type ()));
-
-	return new;
+	return g_object_new (CAMEL_TYPE_IMAPP_STORE_SUMMARY, NULL);
 }
 
 /**

Modified: branches/camel-gobject/camel/providers/imapp/camel-imapp-stream.c
==============================================================================
--- branches/camel-gobject/camel/providers/imapp/camel-imapp-stream.c	(original)
+++ branches/camel-gobject/camel/providers/imapp/camel-imapp-stream.c	Thu Apr 16 00:31:16 2009
@@ -165,7 +165,7 @@
 }
 
 static void
-camel_imapp_stream_finalise(CamelIMAPPStream *is)
+camel_imapp_stream_finalize(CamelIMAPPStream *is)
 {
 	g_free(is->buf);
 	if (is->source)
@@ -186,7 +186,7 @@
 							    (CamelObjectClassInitFunc) camel_imapp_stream_class_init,
 							    NULL,
 							    (CamelObjectInitFunc) camel_imapp_stream_init,
-							    (CamelObjectFinalizeFunc) camel_imapp_stream_finalise );
+							    (CamelObjectFinalizeFunc) camel_imapp_stream_finalize );
 	}
 
 	return camel_imapp_stream_type;
@@ -205,9 +205,8 @@
 {
 	CamelIMAPPStream *is;
 
-	is = (CamelIMAPPStream *)camel_object_new(camel_imapp_stream_get_type ());
-	g_object_ref((CamelObject *)source);
-	is->source = source;
+	is = g_object_new (CAMEL_TYPE_IMAPP_STREAM, NULL);
+	is->source = g_object_ref (source);
 
 	return (CamelStream *)is;
 }

Modified: branches/camel-gobject/camel/providers/imapp/camel-imapp-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/imapp/camel-imapp-summary.c	(original)
+++ branches/camel-gobject/camel/providers/imapp/camel-imapp-summary.c	Thu Apr 16 00:31:16 2009
@@ -105,9 +105,7 @@
 CamelFolderSummary *
 camel_imapp_summary_new(void)
 {
-	CamelFolderSummary *summary = CAMEL_FOLDER_SUMMARY(camel_object_new(camel_imapp_summary_get_type()));
-
-	return summary;
+	return g_object_new (CAMEL_TYPE_IMAPP_SUMMARY, NULL);
 }
 
 

Modified: branches/camel-gobject/camel/providers/local/camel-local-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/local/camel-local-summary.c	(original)
+++ branches/camel-gobject/camel/providers/local/camel-local-summary.c	Thu Apr 16 00:31:16 2009
@@ -68,7 +68,7 @@
 
 static void camel_local_summary_class_init (CamelLocalSummaryClass *klass);
 static void camel_local_summary_init       (CamelLocalSummary *obj);
-static void camel_local_summary_finalise   (CamelObject *obj);
+static void camel_local_summary_finalize   (CamelObject *obj);
 static CamelFolderSummaryClass *camel_local_summary_parent;
 
 GType
@@ -83,7 +83,7 @@
 					   (CamelObjectClassInitFunc) camel_local_summary_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_local_summary_init,
-					   (CamelObjectFinalizeFunc) camel_local_summary_finalise);
+					   (CamelObjectFinalizeFunc) camel_local_summary_finalize);
 	}
 	
 	return type;
@@ -127,7 +127,7 @@
 }
 
 static void
-camel_local_summary_finalise(CamelObject *obj)
+camel_local_summary_finalize(CamelObject *obj)
 {
 	CamelLocalSummary *mbs = CAMEL_LOCAL_SUMMARY(obj);
 

Modified: branches/camel-gobject/camel/providers/local/camel-maildir-folder.c
==============================================================================
--- branches/camel-gobject/camel/providers/local/camel-maildir-folder.c	(original)
+++ branches/camel-gobject/camel/providers/local/camel-maildir-folder.c	Thu Apr 16 00:31:16 2009
@@ -141,7 +141,7 @@
 
 	d(printf("Creating maildir folder: %s\n", full_name));
 
-	folder = (CamelFolder *)camel_object_new(CAMEL_MAILDIR_FOLDER_TYPE);
+	folder = g_object_new (CAMEL_TYPE_MAILDIR_FOLDER, NULL);
 
 	if (parent_store->flags & CAMEL_STORE_FILTER_INBOX
 	    && strcmp(full_name, ".") == 0)

Modified: branches/camel-gobject/camel/providers/local/camel-maildir-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/local/camel-maildir-summary.c	(original)
+++ branches/camel-gobject/camel/providers/local/camel-maildir-summary.c	Thu Apr 16 00:31:16 2009
@@ -65,7 +65,7 @@
 
 static void camel_maildir_summary_class_init	(CamelMaildirSummaryClass *class);
 static void camel_maildir_summary_init	(CamelMaildirSummary *gspaper);
-static void camel_maildir_summary_finalise	(CamelObject *obj);
+static void camel_maildir_summary_finalize	(CamelObject *obj);
 
 #define _PRIVATE(x) (((CamelMaildirSummary *)(x))->priv)
 
@@ -91,7 +91,7 @@
 					   (CamelObjectClassInitFunc)camel_maildir_summary_class_init,
 					   NULL,
 					   (CamelObjectInitFunc)camel_maildir_summary_init,
-					   (CamelObjectFinalizeFunc)camel_maildir_summary_finalise);
+					   (CamelObjectFinalizeFunc)camel_maildir_summary_finalize);
 	}
 	
 	return type;
@@ -145,7 +145,7 @@
 }
 
 static void
-camel_maildir_summary_finalise(CamelObject *obj)
+camel_maildir_summary_finalize(CamelObject *obj)
 {
 	CamelMaildirSummary *o = (CamelMaildirSummary *)obj;
 
@@ -167,8 +167,9 @@
 CamelMaildirSummary
 *camel_maildir_summary_new(struct _CamelFolder *folder, const char *filename, const char *maildirdir, CamelIndex *index)
 {
-	CamelMaildirSummary *o = (CamelMaildirSummary *)camel_object_new(camel_maildir_summary_get_type ());
+	CamelMaildirSummary *o;
 
+	o = g_object_new (CAMEL_TYPE_MAILDIR_SUMMARY, NULL);
 	((CamelFolderSummary *)o)->folder = folder;
 	if (folder) {
 		camel_db_set_collate (folder->parent_store->cdb_r, "dreceived", NULL, NULL);

Modified: branches/camel-gobject/camel/providers/local/camel-mbox-folder.c
==============================================================================
--- branches/camel-gobject/camel/providers/local/camel-mbox-folder.c	(original)
+++ branches/camel-gobject/camel/providers/local/camel-mbox-folder.c	Thu Apr 16 00:31:16 2009
@@ -68,7 +68,7 @@
 static CamelMimeMessage *mbox_get_message(CamelFolder *folder, const gchar * uid, CamelException *ex);
 static CamelLocalSummary *mbox_create_summary(CamelLocalFolder *lf, const char *path, const char *folder, CamelIndex *index);
 
-static void mbox_finalise(CamelObject * object);
+static void mbox_finalize(CamelObject * object);
 
 static void
 camel_mbox_folder_class_init(CamelMboxFolderClass * camel_mbox_folder_class)
@@ -99,7 +99,7 @@
 }
 
 static void
-mbox_finalise(CamelObject * object)
+mbox_finalize(CamelObject * object)
 {
 	CamelMboxFolder *mbox_folder = (CamelMboxFolder *)object;
 
@@ -117,7 +117,7 @@
 							     (CamelObjectClassInitFunc) camel_mbox_folder_class_init,
 							     NULL,
 							     (CamelObjectInitFunc) mbox_init,
-							     (CamelObjectFinalizeFunc) mbox_finalise);
+							     (CamelObjectFinalizeFunc) mbox_finalize);
 	}
 
 	return camel_mbox_folder_type;
@@ -130,7 +130,7 @@
 
 	d(printf("Creating mbox folder: %s in %s\n", full_name, camel_local_store_get_toplevel_dir((CamelLocalStore *)parent_store)));
 
-	folder = (CamelFolder *)camel_object_new(CAMEL_MBOX_FOLDER_TYPE);
+	folder = g_object_new (CAMEL_TYPE_MBOX_FOLDER, NULL);
 	folder = (CamelFolder *)camel_local_folder_construct((CamelLocalFolder *)folder,
 							     parent_store, full_name, flags, ex);
 

Modified: branches/camel-gobject/camel/providers/local/camel-mbox-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/local/camel-mbox-summary.c	(original)
+++ branches/camel-gobject/camel/providers/local/camel-mbox-summary.c	Thu Apr 16 00:31:16 2009
@@ -84,7 +84,7 @@
 
 static void camel_mbox_summary_class_init (CamelMboxSummaryClass *klass);
 static void camel_mbox_summary_init       (CamelMboxSummary *obj);
-static void camel_mbox_summary_finalise   (CamelObject *obj);
+static void camel_mbox_summary_finalize   (CamelObject *obj);
 
 #ifdef STATUS_PINE
 /* Which status flags are stored in each separate header */
@@ -109,7 +109,7 @@
 					   (CamelObjectClassInitFunc) camel_mbox_summary_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_mbox_summary_init,
-					   (CamelObjectFinalizeFunc) camel_mbox_summary_finalise);
+					   (CamelObjectFinalizeFunc) camel_mbox_summary_finalize);
 	}
 	
 	return type;
@@ -207,7 +207,7 @@
 }
 
 static void
-camel_mbox_summary_finalise(CamelObject *obj)
+camel_mbox_summary_finalize(CamelObject *obj)
 {
 	/*CamelMboxSummary *mbs = CAMEL_MBOX_SUMMARY(obj);*/
 }
@@ -245,8 +245,9 @@
 CamelMboxSummary *
 camel_mbox_summary_new(struct _CamelFolder *folder, const char *filename, const char *mbox_name, CamelIndex *index)
 {
-	CamelMboxSummary *new = (CamelMboxSummary *)camel_object_new(camel_mbox_summary_get_type());
+	CamelMboxSummary *new;
 
+	new = g_object_new (CAMEL_TYPE_MBOX_SUMMARY, NULL);
 	((CamelFolderSummary *)new)->folder = folder;
 	if (folder) {
 		CamelFolderSummary *summary = (CamelFolderSummary *)new;
@@ -862,7 +863,7 @@
 		return -1;
 	}
 
-	/* need to dup since mime parser closes its fd once it is finalised */
+	/* need to dup since mime parser closes its fd once it is finalized */
 	pfd = dup(fd);
 	if (pfd == -1) {
 		camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,

Modified: branches/camel-gobject/camel/providers/local/camel-mh-folder.c
==============================================================================
--- branches/camel-gobject/camel/providers/local/camel-mh-folder.c	(original)
+++ branches/camel-gobject/camel/providers/local/camel-mh-folder.c	Thu Apr 16 00:31:16 2009
@@ -109,7 +109,7 @@
 
 	d(printf("Creating mh folder: %s\n", full_name));
 
-	folder = (CamelFolder *)camel_object_new(CAMEL_MH_FOLDER_TYPE);
+	folder = g_object_new (CAMEL_TYPE_MH_FOLDER, NULL);
 	folder = (CamelFolder *)camel_local_folder_construct((CamelLocalFolder *)folder,
 							     parent_store, full_name, flags, ex);
 

Modified: branches/camel-gobject/camel/providers/local/camel-mh-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/local/camel-mh-summary.c	(original)
+++ branches/camel-gobject/camel/providers/local/camel-mh-summary.c	Thu Apr 16 00:31:16 2009
@@ -53,7 +53,7 @@
 
 static void camel_mh_summary_class_init	(CamelMhSummaryClass *class);
 static void camel_mh_summary_init	(CamelMhSummary *gspaper);
-static void camel_mh_summary_finalise	(CamelObject *obj);
+static void camel_mh_summary_finalize	(CamelObject *obj);
 
 #define _PRIVATE(x) (((CamelMhSummary *)(x))->priv)
 
@@ -75,7 +75,7 @@
 					   (CamelObjectClassInitFunc)camel_mh_summary_class_init,
 					   NULL,
 					   (CamelObjectInitFunc)camel_mh_summary_init,
-					   (CamelObjectFinalizeFunc)camel_mh_summary_finalise);
+					   (CamelObjectFinalizeFunc)camel_mh_summary_finalize);
 	}
 	
 	return type;
@@ -108,7 +108,7 @@
 }
 
 static void
-camel_mh_summary_finalise(CamelObject *obj)
+camel_mh_summary_finalize(CamelObject *obj)
 {
 	CamelMhSummary *o = (CamelMhSummary *)obj;
 
@@ -148,8 +148,9 @@
  **/
 CamelMhSummary	*camel_mh_summary_new(struct _CamelFolder *folder, const char *filename, const char *mhdir, CamelIndex *index)
 {
-	CamelMhSummary *o = (CamelMhSummary *)camel_object_new(camel_mh_summary_get_type ());
+	CamelMhSummary *o;
 
+	o = g_object_new (CAMEL_TYPE_MH_SUMMARY, NULL);
 	((CamelFolderSummary *)o)->folder = folder;
 	if (folder) {
 		camel_db_set_collate (folder->parent_store->cdb_r, "uid", "mh_uid_sort", (CamelDBCollate)sort_uid_cmp);

Modified: branches/camel-gobject/camel/providers/local/camel-spool-folder.c
==============================================================================
--- branches/camel-gobject/camel/providers/local/camel-spool-folder.c	(original)
+++ branches/camel-gobject/camel/providers/local/camel-spool-folder.c	Thu Apr 16 00:31:16 2009
@@ -115,7 +115,7 @@
 
 	d(printf("Creating spool folder: %s in %s\n", full_name, camel_local_store_get_toplevel_dir((CamelLocalStore *)parent_store)));
 
-	folder = (CamelFolder *)camel_object_new(CAMEL_SPOOL_FOLDER_TYPE);
+	folder = g_object_new (CAMEL_TYPE_SPOOL_FOLDER, NULL);
 
 	if (parent_store->flags & CAMEL_STORE_FILTER_INBOX
 	    && strcmp(full_name, "INBOX") == 0)

Modified: branches/camel-gobject/camel/providers/local/camel-spool-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/local/camel-spool-summary.c	(original)
+++ branches/camel-gobject/camel/providers/local/camel-spool-summary.c	Thu Apr 16 00:31:16 2009
@@ -54,7 +54,7 @@
 
 static void camel_spool_summary_class_init (CamelSpoolSummaryClass *klass);
 static void camel_spool_summary_init       (CamelSpoolSummary *obj);
-static void camel_spool_summary_finalise   (CamelObject *obj);
+static void camel_spool_summary_finalize   (CamelObject *obj);
 
 static CamelFolderSummaryClass *camel_spool_summary_parent;
 
@@ -70,7 +70,7 @@
 					   (CamelObjectClassInitFunc) camel_spool_summary_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_spool_summary_init,
-					   (CamelObjectFinalizeFunc) camel_spool_summary_finalise);
+					   (CamelObjectFinalizeFunc) camel_spool_summary_finalize);
 	}
 	
 	return type;
@@ -102,7 +102,7 @@
 }
 
 static void
-camel_spool_summary_finalise(CamelObject *obj)
+camel_spool_summary_finalize(CamelObject *obj)
 {
 	/*CamelSpoolSummary *mbs = CAMEL_SPOOL_SUMMARY(obj);*/
 }
@@ -134,8 +134,9 @@
 CamelSpoolSummary *
 camel_spool_summary_new(struct _CamelFolder *folder, const char *mbox_name)
 {
-	CamelSpoolSummary *new = (CamelSpoolSummary *)camel_object_new(camel_spool_summary_get_type());
+	CamelSpoolSummary *new;
 
+	new = g_object_new (CAMEL_TYPE_SPOOL_SUMMARY, NULL);
 	((CamelFolderSummary *)new)->folder = folder;
 	if (folder) {
 		camel_db_set_collate (folder->parent_store->cdb_r, "bdata", "spool_frompos_sort", (CamelDBCollate)frompos_sort);

Modified: branches/camel-gobject/camel/providers/nntp/camel-nntp-folder.c
==============================================================================
--- branches/camel-gobject/camel/providers/nntp/camel-nntp-folder.c	(original)
+++ branches/camel-gobject/camel/providers/nntp/camel-nntp-folder.c	Thu Apr 16 00:31:16 2009
@@ -437,7 +437,7 @@
 }
 
 static void           
-nntp_folder_finalise (CamelNNTPFolder *nntp_folder)
+nntp_folder_finalize (CamelNNTPFolder *nntp_folder)
 {
 	struct _CamelNNTPFolderPrivate *p;
 
@@ -497,7 +497,7 @@
 							      (CamelObjectClassInitFunc) nntp_folder_class_init,
 							      NULL,
 							      (CamelObjectInitFunc) nntp_folder_init,
-							      (CamelObjectFinalizeFunc) nntp_folder_finalise);
+							      (CamelObjectFinalizeFunc) nntp_folder_finalize);
 	}
 	
 	return camel_nntp_folder_type;
@@ -521,7 +521,7 @@
 	/* If this doesn't work, stuff wont save, but let it continue anyway */
 	g_mkdir_with_parents (root, 0777);
 	
-	folder = (CamelFolder *) camel_object_new (CAMEL_NNTP_FOLDER_TYPE);
+	folder = g_object_new (CAMEL_TYPE_NNTP_FOLDER, NULL);
 	nntp_folder = (CamelNNTPFolder *)folder;
 	
 	camel_folder_construct (folder, parent, folder_name, folder_name);

Modified: branches/camel-gobject/camel/providers/nntp/camel-nntp-store-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/nntp/camel-nntp-store-summary.c	(original)
+++ branches/camel-gobject/camel/providers/nntp/camel-nntp-store-summary.c	Thu Apr 16 00:31:16 2009
@@ -58,7 +58,7 @@
 
 static void camel_nntp_store_summary_class_init (CamelNNTPStoreSummaryClass *klass);
 static void camel_nntp_store_summary_init       (CamelNNTPStoreSummary *obj);
-static void camel_nntp_store_summary_finalise   (CamelObject *obj);
+static void camel_nntp_store_summary_finalize   (CamelObject *obj);
 
 static CamelStoreSummaryClass *camel_nntp_store_summary_parent;
 
@@ -92,7 +92,7 @@
 }
 
 static void
-camel_nntp_store_summary_finalise (CamelObject *obj)
+camel_nntp_store_summary_finalize (CamelObject *obj)
 {
 	/*struct _CamelNNTPStoreSummaryPrivate *p;*/
 	/*CamelNNTPStoreSummary *s = (CamelNNTPStoreSummary *)obj;*/
@@ -114,7 +114,7 @@
 					   (CamelObjectClassInitFunc) camel_nntp_store_summary_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_nntp_store_summary_init,
-					   (CamelObjectFinalizeFunc) camel_nntp_store_summary_finalise);
+					   (CamelObjectFinalizeFunc) camel_nntp_store_summary_finalize);
 	}
 	
 	return type;
@@ -130,7 +130,7 @@
 CamelNNTPStoreSummary *
 camel_nntp_store_summary_new (void)
 {
-	return (CamelNNTPStoreSummary *) camel_object_new (camel_nntp_store_summary_get_type ());
+	return g_object_new (CAMEL_TYPE_NNTP_STORE_SUMMARY, NULL);
 }
 
 /**

Modified: branches/camel-gobject/camel/providers/nntp/camel-nntp-stream.c
==============================================================================
--- branches/camel-gobject/camel/providers/nntp/camel-nntp-stream.c	(original)
+++ branches/camel-gobject/camel/providers/nntp/camel-nntp-stream.c	Thu Apr 16 00:31:16 2009
@@ -215,7 +215,7 @@
 }
 
 static void
-camel_nntp_stream_finalise(CamelNNTPStream *is)
+camel_nntp_stream_finalize(CamelNNTPStream *is)
 {
 	g_free(is->buf);
 	g_free(is->linebuf);
@@ -236,7 +236,7 @@
 							    (CamelObjectClassInitFunc) camel_nntp_stream_class_init,
 							    NULL,
 							    (CamelObjectInitFunc) camel_nntp_stream_init,
-							    (CamelObjectFinalizeFunc) camel_nntp_stream_finalise );
+							    (CamelObjectFinalizeFunc) camel_nntp_stream_finalize );
 	}
 
 	return camel_nntp_stream_type;
@@ -255,9 +255,8 @@
 {
 	CamelNNTPStream *is;
 
-	is = (CamelNNTPStream *)camel_object_new(camel_nntp_stream_get_type ());
-	g_object_ref((CamelObject *)source);
-	is->source = source;
+	is = g_object_new (CAMEL_TYPE_NNTP_STREAM, NULL);
+	is->source = g_object_ref (source);
 
 	return (CamelStream *)is;
 }

Modified: branches/camel-gobject/camel/providers/nntp/camel-nntp-summary.c
==============================================================================
--- branches/camel-gobject/camel/providers/nntp/camel-nntp-summary.c	(original)
+++ branches/camel-gobject/camel/providers/nntp/camel-nntp-summary.c	Thu Apr 16 00:31:16 2009
@@ -73,7 +73,7 @@
 
 static void camel_nntp_summary_class_init (CamelNNTPSummaryClass *klass);
 static void camel_nntp_summary_init       (CamelNNTPSummary *obj);
-static void camel_nntp_summary_finalise   (CamelObject *obj);
+static void camel_nntp_summary_finalize   (CamelObject *obj);
 static CamelFolderSummaryClass *camel_nntp_summary_parent;
 
 GType
@@ -88,7 +88,7 @@
 					   (CamelObjectClassInitFunc) camel_nntp_summary_class_init,
 					   NULL,
 					   (CamelObjectInitFunc) camel_nntp_summary_init,
-					   (CamelObjectFinalizeFunc) camel_nntp_summary_finalise);
+					   (CamelObjectFinalizeFunc) camel_nntp_summary_finalize);
 	}
 	
 	return type;
@@ -125,7 +125,7 @@
 }
 
 static void
-camel_nntp_summary_finalise(CamelObject *obj)
+camel_nntp_summary_finalize(CamelObject *obj)
 {
 	CamelNNTPSummary *cns = CAMEL_NNTP_SUMMARY(obj);
 
@@ -135,8 +135,9 @@
 CamelNNTPSummary *
 camel_nntp_summary_new(struct _CamelFolder *folder, const char *path)
 {
-	CamelNNTPSummary *cns = (CamelNNTPSummary *)camel_object_new(camel_nntp_summary_get_type());
+	CamelNNTPSummary *cns;
 
+	cns = g_object_new (CAMEL_TYPE_NNTP_SUMMARY, NULL);
 	((CamelFolderSummary *)cns)->folder = folder;
 
 	camel_folder_summary_set_filename((CamelFolderSummary *)cns, path);

Modified: branches/camel-gobject/camel/providers/pop3/camel-pop3-engine.c
==============================================================================
--- branches/camel-gobject/camel/providers/pop3/camel-pop3-engine.c	(original)
+++ branches/camel-gobject/camel/providers/pop3/camel-pop3-engine.c	Thu Apr 16 00:31:16 2009
@@ -67,7 +67,7 @@
 }
 
 static void
-camel_pop3_engine_finalise(CamelPOP3Engine *pe)
+camel_pop3_engine_finalize(CamelPOP3Engine *pe)
 {
 	/* FIXME: Also flush/free any outstanding requests, etc */
 
@@ -92,7 +92,7 @@
 							     (CamelObjectClassInitFunc) camel_pop3_engine_class_init,
 							     NULL,
 							     (CamelObjectInitFunc) camel_pop3_engine_init,
-							     (CamelObjectFinalizeFunc) camel_pop3_engine_finalise );
+							     (CamelObjectFinalizeFunc) camel_pop3_engine_finalize );
 	}
 
 	return camel_pop3_engine_type;
@@ -139,7 +139,7 @@
 {
 	CamelPOP3Engine *pe;
 
-	pe = (CamelPOP3Engine *)camel_object_new(camel_pop3_engine_get_type ());
+	pe = g_object_new (CAMEL_TYPE_POP3_ENGINE, NULL);
 
 	pe->stream = (CamelPOP3Stream *)camel_pop3_stream_new(source);
 	pe->state = CAMEL_POP3_ENGINE_AUTH;

Modified: branches/camel-gobject/camel/providers/pop3/camel-pop3-folder.c
==============================================================================
--- branches/camel-gobject/camel/providers/pop3/camel-pop3-folder.c	(original)
+++ branches/camel-gobject/camel/providers/pop3/camel-pop3-folder.c	Thu Apr 16 00:31:16 2009
@@ -124,7 +124,7 @@
 
 	d(printf("opening pop3 INBOX folder\n"));
 	
-	folder = CAMEL_FOLDER (camel_object_new (CAMEL_POP3_FOLDER_TYPE));
+	folder = g_object_new (CAMEL_TYPE_POP3_FOLDER, NULL);
 	camel_folder_construct (folder, parent, "inbox", "inbox");
 	
 	/* mt-ok, since we dont have the folder-lock for new() */

Modified: branches/camel-gobject/camel/providers/pop3/camel-pop3-stream.c
==============================================================================
--- branches/camel-gobject/camel/providers/pop3/camel-pop3-stream.c	(original)
+++ branches/camel-gobject/camel/providers/pop3/camel-pop3-stream.c	Thu Apr 16 00:31:16 2009
@@ -217,7 +217,7 @@
 }
 
 static void
-camel_pop3_stream_finalise(CamelPOP3Stream *is)
+camel_pop3_stream_finalize(CamelPOP3Stream *is)
 {
 	g_free(is->buf);
 	g_free(is->linebuf);
@@ -238,7 +238,7 @@
 							    (CamelObjectClassInitFunc) camel_pop3_stream_class_init,
 							    NULL,
 							    (CamelObjectInitFunc) camel_pop3_stream_init,
-							    (CamelObjectFinalizeFunc) camel_pop3_stream_finalise );
+							    (CamelObjectFinalizeFunc) camel_pop3_stream_finalize );
 	}
 
 	return camel_pop3_stream_type;
@@ -257,9 +257,8 @@
 {
 	CamelPOP3Stream *is;
 
-	is = (CamelPOP3Stream *)camel_object_new(camel_pop3_stream_get_type ());
-	g_object_ref((CamelObject *)source);
-	is->source = source;
+	is = g_object_new (CAMEL_TYPE_POP3_STREAM, NULL);
+	is->source = g_object_ref (source);
 
 	return (CamelStream *)is;
 }

Modified: branches/camel-gobject/camel/tests/lib/messages.c
==============================================================================
--- branches/camel-gobject/camel/tests/lib/messages.c	(original)
+++ branches/camel-gobject/camel/tests/lib/messages.c	Thu Apr 16 00:31:16 2009
@@ -37,7 +37,7 @@
 }
 
 static void
-content_finalise(CamelObject *folder, void *crap, void *ba)
+content_finalize(CamelObject *folder, void *crap, void *ba)
 {
 	g_byte_array_free(ba, TRUE);
 }
@@ -74,7 +74,7 @@
 		content = (CamelStreamMem *)camel_stream_mem_new();
 		camel_stream_mem_set_byte_array(content, ba);
 
-		camel_object_hook_event((CamelObject *)content, "finalize", content_finalise, ba);
+		camel_object_hook_event((CamelObject *)content, "finalize", content_finalize, ba);
 		break;
 	}
 

Modified: branches/camel-gobject/camel/tests/lib/session.c
==============================================================================
--- branches/camel-gobject/camel/tests/lib/session.c	(original)
+++ branches/camel-gobject/camel/tests/lib/session.c	Thu Apr 16 00:31:16 2009
@@ -36,8 +36,7 @@
 {
 	CamelSession *session;
 	
-	session = CAMEL_SESSION (camel_object_new (CAMEL_TEST_SESSION_TYPE));
-	
+	session = g_object_new (CAMEL_TYPE_TEST_SESSION, NULL);
 	camel_session_construct (session, path);
 	
 	return session;

Modified: branches/camel-gobject/camel/tests/smime/pgp-mime.c
==============================================================================
--- branches/camel-gobject/camel/tests/smime/pgp-mime.c	(original)
+++ branches/camel-gobject/camel/tests/smime/pgp-mime.c	Thu Apr 16 00:31:16 2009
@@ -113,8 +113,7 @@
 {
 	CamelSession *session;
 	
-	session = CAMEL_SESSION (camel_object_new (CAMEL_PGP_SESSION_TYPE));
-	
+	session = g_object_new (CAMEL_TYPE_PGP_SESSION, NULL);
 	camel_session_construct (session, path);
 	
 	return session;

Modified: branches/camel-gobject/camel/tests/smime/pgp.c
==============================================================================
--- branches/camel-gobject/camel/tests/smime/pgp.c	(original)
+++ branches/camel-gobject/camel/tests/smime/pgp.c	Thu Apr 16 00:31:16 2009
@@ -106,8 +106,7 @@
 {
 	CamelSession *session;
 	
-	session = CAMEL_SESSION (camel_object_new (CAMEL_PGP_SESSION_TYPE));
-	
+	session = g_object_new (CAMEL_TYPE_PGP_SESSION, NULL);
 	camel_session_construct (session, path);
 	
 	return session;

Modified: branches/camel-gobject/camel/tests/smime/pkcs7.c
==============================================================================
--- branches/camel-gobject/camel/tests/smime/pkcs7.c	(original)
+++ branches/camel-gobject/camel/tests/smime/pkcs7.c	Thu Apr 16 00:31:16 2009
@@ -78,8 +78,7 @@
 {
 	CamelSession *session;
 	
-	session = CAMEL_SESSION (camel_object_new (CAMEL_TEST_SESSION_TYPE));
-	
+	session = g_object_new (CAMEL_TYPE_TEST_SESSION, NULL);
 	camel_session_construct (session, path);
 	
 	return session;



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