Set the right parent class
authorChenthill Palanisamy <pchenthill@novell.com>
Wed, 3 Mar 2010 00:54:43 +0000 (06:24 +0530)
committerChenthill Palanisamy <pchenthill@novell.com>
Wed, 3 Mar 2010 00:54:43 +0000 (06:24 +0530)
camel/providers/imapx/camel-imapx-folder.c
camel/providers/imapx/camel-imapx-folder.h
camel/providers/imapx/camel-imapx-store.c

index 51a85b9..6d2b253 100644 (file)
@@ -53,7 +53,8 @@
 #define d(x)
 
 #define CF_CLASS(o) (CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(o)))
-static CamelFolderClass *parent_class;
+static CamelObjectClass *parent_class;
+static CamelOfflineFolderClass *offline_folder_class = NULL;
 
 CamelFolder *
 camel_imapx_folder_new(CamelStore *store, const gchar *folder_dir, const gchar *folder_name, CamelException *ex)
@@ -397,6 +398,8 @@ imapx_search_by_expression (CamelFolder *folder, const gchar *expression, CamelE
 static void
 imap_folder_class_init (CamelIMAPXFolderClass *klass)
 {
+       offline_folder_class = CAMEL_OFFLINE_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_offline_folder_get_type ()));
+       
        ((CamelFolderClass *)klass)->refresh_info = imapx_refresh_info;
        ((CamelFolderClass *)klass)->sync = imapx_sync;
        ((CamelFolderClass *)klass)->search_by_expression = imapx_search_by_expression;
@@ -445,14 +448,14 @@ camel_imapx_folder_get_type (void)
        static CamelType camel_imapx_folder_type = CAMEL_INVALID_TYPE;
 
        if (!camel_imapx_folder_type) {
-               camel_imapx_folder_type = camel_type_register (CAMEL_FOLDER_TYPE, "CamelIMAPXFolder",
+               parent_class = camel_offline_folder_get_type();
+               camel_imapx_folder_type = camel_type_register (parent_class, "CamelIMAPXFolder",
                                                              sizeof (CamelIMAPXFolder),
                                                              sizeof (CamelIMAPXFolderClass),
                                                              (CamelObjectClassInitFunc)imap_folder_class_init,
                                                              NULL,
                                                              imap_folder_init,
                                                              (CamelObjectFinalizeFunc) imap_finalize);
-               parent_class = (CamelFolderClass *)camel_folder_get_type();
        }
 
        return camel_imapx_folder_type;
index b331bec..e005ad7 100644 (file)
@@ -29,6 +29,7 @@ extern "C" {
 #pragma }
 #endif /* __cplusplus }*/
 
+#include <camel/camel-offline-folder.h>
 #include <camel/camel-folder.h>
 #include <camel/camel-data-cache.h>
 
@@ -38,7 +39,7 @@ extern "C" {
 #define CAMEL_IS_IMAPX_FOLDER(o)    (CAMEL_CHECK_TYPE((o), CAMEL_IMAPX_FOLDER_TYPE))
 
 typedef struct _CamelIMAPXFolder {
-       CamelFolder parent_object;
+       CamelOfflineFolder parent_object;
 
        gchar *raw_name;
        CamelDataCache *cache;
@@ -51,7 +52,7 @@ typedef struct _CamelIMAPXFolder {
 } CamelIMAPXFolder;
 
 typedef struct _CamelIMAPXFolderClass {
-       CamelFolderClass parent_class;
+       CamelOfflineFolderClass parent_class;
 } CamelIMAPXFolderClass;
 
 /* Standard Camel function */
index 20b17cf..ce7e2ca 100644 (file)
@@ -61,7 +61,7 @@
 /* Specified in RFC 2060 section 2.1 */
 #define IMAP_PORT 143
 
-static CamelStoreClass *parent_class = NULL;
+static CamelOfflineStoreClass *parent_class = NULL;
 
 static guint
 imapx_name_hash(gconstpointer key)
@@ -852,7 +852,7 @@ camel_imapx_store_class_init(CamelIMAPXStoreClass *klass)
        CamelServiceClass *camel_service_class = CAMEL_SERVICE_CLASS(klass);
        CamelStoreClass *camel_store_class = CAMEL_STORE_CLASS(klass);
 
-       parent_class = CAMEL_STORE_CLASS(camel_type_get_global_classfuncs(camel_store_get_type()));
+       parent_class = CAMEL_OFFLINE_STORE_CLASS (camel_type_get_global_classfuncs (camel_offline_store_get_type ()));
 
        camel_service_class->construct = imapx_construct;
        camel_service_class->query_auth_types = imapx_query_auth_types;