aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--camel/Makefile.am2
-rw-r--r--camel/camel-session.c7
-rw-r--r--camel/camel-session.h5
-rw-r--r--camel/camel-store.c53
-rw-r--r--camel/camel-store.h8
6 files changed, 62 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 0e324a0f86..82ea43e27f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
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
+
+1999-04-25 bertrand <Bertrand.Guiheneuf@inria.fr>
+
* camel/camel-session.c (camel_session_set_provider):
new method to set the default provider for a protocol.
(camel_session_get_store_from_provider):
diff --git a/camel/Makefile.am b/camel/Makefile.am
index 7edbc279f6..30e267e9c9 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -16,6 +16,7 @@ libcamel_la_SOURCES = \
camel-folder.c \
camel-provider.c \
camel-service.c \
+ camel-session.c \
camel-store.c \
gstring-util.c \
url-util.c
@@ -25,6 +26,7 @@ libcamelinclude_HEADERS = \
camel-folder.h \
camel-provider.h \
camel-service.h \
+ camel-session.h \
camel-store.h \
gstring-util.h \
url-util.h
diff --git a/camel/camel-session.c b/camel/camel-session.c
index 6acde38d79..a5d48a69ab 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -46,8 +46,8 @@ camel_session_class_init (CamelSessionClass *camel_session_class)
static void
camel_session_init (CamelSession *session)
{
- store_provider_list = g_hash_table_new (g_str_hash, g_str_equal);
- transport_provider_list = g_hash_table_new (g_str_hash, g_str_equal);
+ session->store_provider_list = g_hash_table_new (g_str_hash, g_str_equal);
+ session->transport_provider_list = g_hash_table_new (g_str_hash, g_str_equal);
}
@@ -126,6 +126,7 @@ camel_session_get_store_from_provider (CamelSession *session, CamelProvider *pro
g_assert(provider);
store = gtk_object_new (provider->object_type, NULL);
-#warning add session initialisation on object
+#warning set the url to a useful value.
+ camel_store_init(store, session, NULL);
return store;
}
diff --git a/camel/camel-session.h b/camel/camel-session.h
index d6242182cd..0fb881ea72 100644
--- a/camel/camel-session.h
+++ b/camel/camel-session.h
@@ -32,7 +32,11 @@ extern "C" {
#endif /* __cplusplus }*/
#include <gtk/gtk.h>
+
+typedef struct _CamelSession CamelSession;
+
#include "camel-provider.h"
+#include "camel-store.h"
#define CAMEL_SESSION_TYPE (camel_session_get_type ())
#define CAMEL_SESSION(obj) (GTK_CHECK_CAST((obj), CAMEL_SESSION_TYPE, CamelSession))
@@ -41,7 +45,6 @@ extern "C" {
-typedef struct _CamelSession CamelSession;
struct _CamelSession
{
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.
diff --git a/camel/camel-store.h b/camel/camel-store.h
index 55401577d0..df8409f92e 100644
--- a/camel/camel-store.h
+++ b/camel/camel-store.h
@@ -37,6 +37,7 @@ typedef struct _CamelStore CamelStore;
#include "camel-folder.h"
#include "camel-service.h"
+#include "camel-session.h"
#define CAMEL_STORE_TYPE (camel_store_get_type ())
#define CAMEL_STORE(obj) (GTK_CHECK_CAST((obj), CAMEL_STORE_TYPE, CamelStore))
@@ -48,6 +49,8 @@ struct _CamelStore
{
CamelService parent_object;
+ CamelSession *session;
+ GString *url_name;
gchar separator;
};
@@ -55,7 +58,8 @@ struct _CamelStore
typedef struct {
CamelServiceClass parent_class;
-
+
+ void (*init) (CamelStore *store, CamelSession *session, GString *url_name);
void (*set_separator) (CamelStore *store, gchar sep);
gchar (*get_separator) (CamelStore *store);
CamelFolder * (*get_folder) (CamelStore *store, GString *folder_name);
@@ -70,7 +74,7 @@ typedef struct {
/* Standard Gtk function */
GtkType camel_store_get_type (void);
-CamelStore *camel_store_new(GString *url);
+void camel_store_init(CamelStore *store, CamelSession *session, GString *url_name);
CamelFolder *camel_store_get_folder(CamelStore *store, GString *folder_name);
gchar camel_store_get_separator(CamelStore *store);
rtions'>+10 * - Remove manual creation and removal of share/applications, as it's now in th...amdmi32013-10-2216-18/+1 * - Update from 3.7.52 to 3.7.54danilo2013-10-222-3/+3 * Update to 2.2.5antoine2013-10-152-19/+24 * Update to 3.3.3.0mr2013-10-124-127/+369 * Apply fixes provided by Maxmr2013-10-101-26/+21 * Try to fix the build.mr2013-10-101-11/+10 * - Convert to USES= qmakemakc2013-10-091-11/+8 * cad/varkon: Hardcode PLATFORM to "FreeBSD"marino2013-10-071-2/+2 * - Change maintainer email to @FreeBSD.orgdanilo2013-10-063-27/+23 * Removed dependency on gwavebapt2013-10-051-9/+3 * Remove the EOLed x11-toolkits/guile-gtk (gnome1) and its latest userbapt2013-10-057-159/+0 * The FreeBSD graphics/x11 team proudly presentszeising2013-09-302-1/+2 * - Update to 2.8.3.stephen2013-09-284-31/+22 * - Fix on CURRENT [1]gahr2013-09-273-7/+23 * - Update from 3.7.51 to 3.7.52danilo2013-09-263-29/+17 * - Update from 9.7.81 to 9.7.82danilo2013-09-253-11/+8 * - Remove NO_STAGE as these have been tested to be safebdrewery2013-09-253-3/+0 * - Remove cad/tkgate: it segfaults on startup, and has been doing so for as longgahr2013-09-2521-2802/+0 * - Convert to USES+=tkgahr2013-09-231-2/+2 * Add NO_STAGE all over the place in preparation for the staging support (cat: ...bapt2013-09-20103-205/+145 * - Remove last vestiges of MAKE_JOBS_SAFE knobak2013-09-201-2/+0 * - Unbreak on CURRENT by adding USE_GCC= yesgahr2013-09-181-0/+1 * Fix plistmr2013-09-182-2/+2 * Update to a newer snapshot.mr2013-09-185-141/+810 * - Update to 0.80.1nemysis2013-09-185-67/+50 * - Update to 201301nemysis2013-09-183-11/+60 * Convert to new perl frameworkbapt2013-09-171-5/+2 * - Set make_jobs_unsafe.stephen2013-09-161-0/+2 * - convert to the new perl5 frameworkaz2013-09-131-2/+2 * Add explicit dependency on pkgconf (11 ports)marino2013-09-121-5/+2 * Add GLU to the build dependenciesmr2013-09-111-0/+1 * cad/ldraw: Mark BROKEN, checksum mismatchmarino2013-09-101-0/+1 * - convert to the new perl5 frameworkaz2013-09-101-6/+3 * - Use single space after WWW:sunpoet2013-09-081-1/+1 * cad/freehdl: fix build with clangwg2013-09-066-1/+92 * cad/irsim: update to 9.7.81wg2013-09-062-18/+14 * Add an explicit dependency on pkgconfbapt2013-09-051-2/+1 * Introduce ICONV_CONFIGURE_ARG variable defined at Uses/iconv.mk.bsam2013-09-051-1/+1 * cad/repsnapper: update to 2.2.0b3wg2013-09-042-4/+4 * Add two more dependencies.mr2013-09-041-2/+2 * Add an explicit dependency on pkgconfbapt2013-09-032-7/+3 * Add an explicit dependency on pkgconfbapt2013-09-032-5/+3 * Add an explicit dependency on pkgconfbapt2013-09-032-11/+4 * Add an explicit dependency on pkgconfbapt2013-09-031-1/+1 * Add an explicit dependency on pkgconfbapt2013-09-031-1/+1 * Add an explicit dependency on pkgconfbapt2013-09-031-2/+1 * Fix a hidden USE_GNOME=pkgconfigbapt2013-09-031-9/+3 * cad/repsnapper: update to 2.2.0b2wg2013-09-022-24/+23 * Add an explicit dependency on pkgconfigbapt2013-09-021-1/+1 * Add moc to the dependencies to fix the build.mr2013-08-291-1/+1 * Now metis-edf is selectable.maho2013-08-271-1/+11 * - Update to version from 12 August 2013danfe2013-08-253-27/+19 * Readd qcad and upgrade to version 3.2.1mr2013-08-2117-0/+10303 * Replace USE_GCC=4.6+ and USE_GCC=4.4+ by USE_GCC=yes.gerald2013-08-182-2/+2 * update to 2.6.1maho2013-08-167-58/+199 * - Remove MAKE_JOBS_SAFE variableak2013-08-1521-21/+0 * - update libdg to 2.1.0dinoex2013-08-092-2/+2 * - Update to 2.8.2.stephen2013-08-053-6/+11 * - Convert to new perl frameworkmat2013-08-034-8/+8 * Mark as broken: does not configure on any support versionbapt2013-07-291-4/+3 * KDE3 and QT3 expired on 2013-07-01, remove these ports.rene2013-07-2731-1545/+0 * Change maintainership from @ports to new maintainer. From thedeischen2013-07-273-32/+69 * cad/pdnmesh: Specify libmath explicitly to linker to unbreak build.marino2013-07-241-4/+1 * - Make graphics/togl's libraries location independent from the Tcl/Tk versiongahr2013-07-241-3/+2 * Mark as broken, does not buildbapt2013-07-241-0/+2 * - Changed my emailvg2013-07-221-1/+1 * - Update to 1.0.3makc2013-07-203-24/+42 * - Update to 3.7.51miwi2013-07-172-3/+3 * cad/pcb: unbreak after USES= gmakemarino2013-07-151-1/+1 * - Update to 4.1madpilot2013-07-134-13/+17 * Mark as job unsafebapt2013-07-131-1/+2 * Mark jobs unsafebapt2013-07-121-6/+4 * Mark jobs unsafebapt2013-07-101-0/+1 * Convert from USE_MOTIF to USES=motifbapt2013-07-105-19/+11 * - Remove optional dependency on deprecated QT3rene2013-07-031-13/+3 * Fix installation when DRAW is not selected.thierry2013-07-031-1/+1 * cad/electric-ng: update to 9.0.4wg2013-06-233-18/+20 * Update to 3.3.47.zeising2013-06-232-4/+4 * Update to version 7.24.0pawel2013-06-224-2082/+2416 * cad/openvsp: update to 2.2.4wg2013-06-182-7/+6 * cad/ngspice_rework: update to 25wg2013-06-1310-120/+163 * - Trim headermiwi2013-06-121-5/+1 * Update to 3.7.50.rakuco2013-06-122-3/+3 * - Fix i18n manpagesmiwi2013-06-111-0/+4 * - Update to 4.0.hrs2013-06-014-17/+58 * The FreeBSD x11 team proudly presentszeising2013-05-254-14/+10 * - Update to 3.7.49bdrewery2013-05-222-3/+3 * Do quite a bit of cleanup work for cad/gspiceui. This means:zeising2013-05-202-33/+36 * - Source tarball was rerolled. diff indicates changes were harmless.stephen2013-05-174-4/+7 * - Change option OCC (build with opencascade libraries) to default to on.stephen2013-05-174-3/+42 * Unbreak on FreeBSD-8.x.thierry2013-05-174-5/+38 * - Fix PLISTgahr2013-05-151-0/+2 * Update to 2.2.0a4.rakuco2013-05-153-6/+7 * - Update to 7.5.231miwi2013-05-152-3/+3 * - Fix run-time with Tcl/Tk 8.6gahr2013-05-142-3/+10 * - Update to 2.0-b10gahr2013-05-1419-546/+2752 * Update to 3.3.46zeising2013-05-134-17/+22 * xlocale.h is required: mark BROKEN on FreeBSD-8.x until I have a fix.thierry2013-05-131-0/+4 * Chase OpenCascade's upgrade, thus fixing the slave port cad/gmsh-occ.thierry2013-05-131-1/+1 * Upgrade to 6.6.0, with several patches from Andrea Venturoli <ml (at)thierry2013-05-1341-69218/+14468 * - Add global options (DOCS, NLS, etc) to the OPTIONS_DEFINE and partly revert...makc2013-05-122-6/+3 * - Source tarball was rerolled. Diffing old and new sources indicatesstephen2013-05-122-2/+3 * - Update to 2.7.1.stephen2013-05-124-15/+15 * - Update the Makefile headerwen2013-05-111-2/+1 * - Update to 2013.1 [1]wen2013-05-11