From d3d2adb98ce84c89f5e2c648329764d55d8ec412 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 21 Feb 2000 18:38:58 +0000 Subject: add CamelExceptions to several functions. Use camel_session_new to * camel-session.h: * camel-session.c: add CamelExceptions to several functions. Use camel_session_new to initialize the session and URL fields of created CamelStores as appropriate. * camel-store.h: * camel-store.c * camel-service.h: * camel-service.c: Move the session and url (and associated functions) from CamelStore to CamelService. Add url_flags to CamelService so subclasses can specify which URL components are mandatory for them. Add camel_session_new for camel_session_get_store* to use. * providers/mbox/camel-mbox-folder.c: * providers/mbox/camel-mbox-store.c: * providers/mbox/camel-mbox-store.h: Update for above changes. svn path=/trunk/; revision=1888 --- camel/camel-store.c | 82 ----------------------------------------------------- 1 file changed, 82 deletions(-) (limited to 'camel/camel-store.c') diff --git a/camel/camel-store.c b/camel/camel-store.c index 1938fcbd3f..dee1ef295c 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -36,29 +36,21 @@ static CamelServiceClass *parent_class = NULL; static void _set_separator(CamelStore *store, gchar sep, CamelException *ex); static CamelFolder *_get_root_folder(CamelStore *store, CamelException *ex); static CamelFolder *_get_default_folder(CamelStore *store, CamelException *ex); -static void _init(CamelStore *store, CamelSession *session, const gchar *url_name, CamelException *ex); static CamelFolder *_get_folder (CamelStore *store, const gchar *folder_name, CamelException *ex); static gchar _get_separator (CamelStore *store, CamelException *ex); -static void _finalize (GtkObject *object); - static void camel_store_class_init (CamelStoreClass *camel_store_class) { - GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (camel_store_class); parent_class = gtk_type_class (camel_service_get_type ()); /* virtual method definition */ - camel_store_class->init = _init; camel_store_class->set_separator = _set_separator; camel_store_class->get_separator = _get_separator; camel_store_class->get_folder = _get_folder; camel_store_class->get_root_folder = _get_root_folder; camel_store_class->get_default_folder = _get_default_folder; - - /* virtual method overload */ - gtk_object_class->finalize = _finalize; } @@ -94,65 +86,6 @@ camel_store_get_type (void) - -/** - * camel_store_init: call store's init method - * @store: the store to initialize - * @session: session which instantiates the store - * @url_name: URL defining the store - * - * This routine is called by the session object from which this - * store is created. It must not be called directly. - * - **/ -void -camel_store_init (CamelStore *store, CamelSession *session, const gchar *url_name, CamelException *ex) -{ - g_assert(store); - CS_CLASS(store)->init (store, session, url_name, ex); -} - - -/** - * init: method called by a session object to initialize a store object - * @store: the store to initialize - * @session: session which instantiates the store - * @url_name: URL defining the store - * - * This routine is called by the session object from which this - * store is created. Be careful, @url_name is used as a private field - * of the store object. - * - **/ -static void -_init (CamelStore *store, CamelSession *session, const gchar *url_name, CamelException *ex) -{ - -#warning re-enable assertion here. - g_assert(session); - g_assert(url_name); - - store->session = session; - gtk_object_ref (GTK_OBJECT (session)); - /*store->url_name = url_name;*/ -} - - -static void -_finalize (GtkObject *object) -{ - CamelStore *camel_store = CAMEL_STORE (object); - CAMEL_LOG_FULL_DEBUG ("Entering CamelStore::finalize\n"); - - /* if (camel_store->url_name) g_free (camel_store->url_name); */ - if (camel_store->session) gtk_object_unref (GTK_OBJECT (camel_store->session)); - - GTK_OBJECT_CLASS (parent_class)->finalize (object); - CAMEL_LOG_FULL_DEBUG ("Leaving CamelStore::finalize\n"); -} - - - /** * camel_store_set_separator: set the character which separates this folder path from the folders names in a lower level of hierarchy. * @@ -259,18 +192,3 @@ _get_default_folder (CamelStore *store, CamelException *ex) { return NULL; } - - -CamelSession * -camel_store_get_session (CamelStore *store, CamelException *ex) -{ - if (!store) { - camel_exception_set (ex, - CAMEL_EXCEPTION_STORE_NULL, - "Store is NULL"); - return NULL; - } - - return store->session; -} - -- cgit