aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-store.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@inria.fr>1999-04-26 05:58:27 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-04-26 05:58:27 +0800
commitd224d1aaad9aca13a716278df6f81b96e9d58aea (patch)
treeec269e529e97d904e3bae5487c7a1d702f2b2cd2 /camel/camel-store.c
parentf9595bb213b103bf071e97ea2f93886767aa7f64 (diff)
downloadgsoc2013-evolution-d224d1aaad9aca13a716278df6f81b96e9d58aea.tar.gz
gsoc2013-evolution-d224d1aaad9aca13a716278df6f81b96e9d58aea.tar.zst
gsoc2013-evolution-d224d1aaad9aca13a716278df6f81b96e9d58aea.zip
initialize folder object.
1999-04-25 bertrand <Bertrand.Guiheneuf@inria.fr> * camel/camel-session.c (camel_session_get_store_from_provider): initialize folder object. * camel/camel-store.c (init): new method. called by session object at instantiation time. * camel/camel-store.h (struct _CamelStore): new fields : session and url_name svn path=/trunk/; revision=879
Diffstat (limited to 'camel/camel-store.c')
-rw-r--r--camel/camel-store.c53
1 files changed, 35 insertions, 18 deletions
diff --git a/camel/camel-store.c b/camel/camel-store.c
index a5ade87053..ba709916b0 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -31,6 +31,7 @@ static GtkObjectClass *parent_class=NULL;
static void camel_store_set_separator(CamelStore *store, gchar sep);
static CamelFolder *camel_store_get_root_folder(CamelStore *store);
static CamelFolder *camel_store_get_default_folder(CamelStore *store);
+static void __camel_store_init(CamelStore *store, CamelSession *session, GString *url_name);
@@ -40,6 +41,7 @@ camel_store_class_init (CamelStoreClass *camel_store_class)
parent_class = gtk_type_class (camel_service_get_type ());
/* virtual method definition */
+ camel_store_class->init = __camel_store_init;
camel_store_class->set_separator = camel_store_set_separator;
camel_store_class->get_separator = camel_store_get_separator;
camel_store_class->get_folder = camel_store_get_folder;
@@ -83,33 +85,48 @@ camel_store_get_type (void)
/**
- * camel_store_new: create a new store from an URL
- * @url: The url representing this store
+ * 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.
*
- * This routine creates a store from an URL name.
- * The URL may be for example:
- * pop3://user:passwd@host
+ **/
+void
+camel_store_init(CamelStore *store, CamelSession *session, GString *url_name)
+{
+ g_assert(store);
+ CS_CLASS(store)->init(store, session, url_name);
+}
+
+
+/**
+ * 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
*
- * WARNING : THIS METHOD DEFINITION IS SUBJECT TO
- * CHANGES.
+ * This routine is called by the session object from which this
+ * store is created.
*
- * Return value: the newly created store
**/
-CamelStore *
-camel_store_new(GString *url)
+static void
+__camel_store_init(CamelStore *store, CamelSession *session, GString *url_name)
{
- /* this method must be overloaded by providers */
- CamelStore *store;
-#warning must fill this
- /* here si what will happen here :
- In fact the method will take a Session object as a supplemental
- argument. From this object and from the url protocol
- (pop/mh/mbox ...) the correct provider will be selected an the
- corresponding store object will be created */
+
+ g_assert(session);
+ g_assert(url_name);
+
+ store->session = session;
+ store->url_name = url_name;
}
+
/**
* camel_store_set_separator: set the character which separates this folder
* path from the folders names in a lower level of hierarchy.