[evolution-data-server] Convert CamelObject events to GObject signals.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Convert CamelObject events to GObject signals.
- Date: Fri, 7 May 2010 22:32:12 +0000 (UTC)
commit 8318aef0d03603c8aacd10478294b91890d78d1a
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun May 2 21:04:54 2010 -0400
Convert CamelObject events to GObject signals.
Also, bump libcamel's soname to 16 since 2.31.1 was released with 15.
camel/Makefile.am | 7 +-
camel/camel-disco-folder.c | 9 +-
camel/camel-disco-store.c | 15 +-
camel/camel-folder-summary.c | 6 +-
camel/camel-folder.c | 586 +++++++++++---------
camel/camel-folder.h | 10 +
camel/camel-gpg-context.c | 2 +-
camel/camel-marshal.list | 1 +
camel/camel-object.c | 539 ++----------------
camel/camel-object.h | 33 +-
camel/camel-offline-folder.c | 9 +-
camel/camel-offline-store.c | 17 +-
camel/camel-session.c | 172 +++++-
camel/camel-session.h | 255 +++++-----
camel/camel-store.c | 218 +++++++-
camel/camel-store.h | 37 +-
camel/camel-vee-folder.c | 55 ++-
camel/camel-vee-store.c | 5 +-
camel/camel-vee-summary.c | 2 +-
camel/providers/groupwise/camel-groupwise-folder.c | 12 +-
camel/providers/groupwise/camel-groupwise-store.c | 6 +-
.../providers/groupwise/camel-groupwise-summary.c | 4 +-
camel/providers/imap/camel-imap-folder.c | 13 +-
camel/providers/imap/camel-imap-message-cache.c | 48 +-
camel/providers/imap/camel-imap-store.c | 21 +-
camel/providers/imapx/camel-imapx-server.c | 22 +-
camel/providers/imapx/camel-imapx-store.c | 17 +-
camel/providers/local/camel-local-folder.c | 6 +-
camel/providers/local/camel-local-store.c | 7 +-
camel/providers/local/camel-maildir-folder.c | 4 +-
camel/providers/local/camel-mbox-folder.c | 6 +-
camel/providers/local/camel-mbox-store.c | 3 +-
camel/providers/local/camel-mh-folder.c | 4 +-
camel/providers/nntp/camel-nntp-folder.c | 4 +-
camel/providers/nntp/camel-nntp-store.c | 10 +-
configure.ac | 2 +-
docs/reference/camel/Makefile.am | 1 +
docs/reference/camel/camel-sections.txt | 25 +-
.../reference/camel/tmpl/camel-cipher-context.sgml | 14 +
docs/reference/camel/tmpl/camel-folder.sgml | 31 +
docs/reference/camel/tmpl/camel-object.sgml | 78 ---
docs/reference/camel/tmpl/camel-session.sgml | 23 +-
docs/reference/camel/tmpl/camel-store.sgml | 104 ++++-
docs/reference/camel/tmpl/camel-unused.sgml | 111 ++++
44 files changed, 1335 insertions(+), 1219 deletions(-)
---
diff --git a/camel/Makefile.am b/camel/Makefile.am
index a411f4e..d1b20f9 100644
--- a/camel/Makefile.am
+++ b/camel/Makefile.am
@@ -14,6 +14,9 @@ LIBCAMEL_PROVIDER_PLATFORM_DEP_SOURCES = camel-movemail.c
LOCK_HELPER = camel-lock-helper-1.2
endif
+MARSHAL_GENERATED = camel-marshal.c camel-marshal.h
+ EVO_MARSHAL_RULE@
+
%-$(API_VERSION).pc: %.pc
cp $< $@
@@ -158,6 +161,7 @@ libcamel_1_2_la_CPPFLAGS = \
$(CAMEL_CFLAGS)
libcamel_1_2_la_SOURCES = \
+ $(MARSHAL_GENERATED) \
camel-address.c \
camel-block-file.c \
camel-certdb.c \
@@ -394,10 +398,11 @@ noinst_HEADERS = \
camel-charset-map-private.h \
camel-win32.h
-BUILT_SOURCES = camel-mime-tables.c
+BUILT_SOURCES = camel-mime-tables.c $(MARSHAL_GENERATED)
EXTRA_DIST = \
$(pkgconfig_in_files) \
+ camel-marshal.list \
gentables.pl \
README
diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c
index 19d9b70..24b6a79 100644
--- a/camel/camel-disco-folder.c
+++ b/camel/camel-disco-folder.c
@@ -101,7 +101,8 @@ static CamelSessionThreadOps cdf_sync_ops = {
};
static void
-cdf_folder_changed(CamelFolder *folder, CamelFolderChangeInfo *changes, gpointer dummy)
+cdf_folder_changed (CamelFolder *folder,
+ CamelFolderChangeInfo *changes)
{
CamelStore *parent_store;
gboolean offline_sync;
@@ -419,9 +420,9 @@ camel_disco_folder_init (CamelDiscoFolder *disco_folder)
{
disco_folder->priv = CAMEL_DISCO_FOLDER_GET_PRIVATE (disco_folder);
- camel_object_hook_event (
- disco_folder, "folder_changed",
- (CamelObjectEventHookFunc) cdf_folder_changed, NULL);
+ g_signal_connect (
+ disco_folder, "changed",
+ G_CALLBACK (cdf_folder_changed), NULL);
}
/**
diff --git a/camel/camel-disco-store.c b/camel/camel-disco-store.c
index fe315d1..38d8c32 100644
--- a/camel/camel-disco-store.c
+++ b/camel/camel-disco-store.c
@@ -53,7 +53,7 @@ disco_store_construct (CamelService *service,
if (!service_class->construct (service, session, provider, url, ex))
return FALSE;
- disco->status = camel_session_is_online (session) ?
+ disco->status = camel_session_get_online (session) ?
CAMEL_DISCO_STORE_ONLINE : CAMEL_DISCO_STORE_OFFLINE;
return TRUE;
@@ -216,7 +216,7 @@ disco_store_set_status (CamelDiscoStore *disco_store,
{
CamelException x;
CamelService *service = CAMEL_SERVICE (disco_store);
- gboolean network_state = camel_session_get_network_state (service->session);
+ gboolean network_available;
if (disco_store->status == status)
return;
@@ -225,7 +225,10 @@ disco_store_set_status (CamelDiscoStore *disco_store,
/* Sync the folder fully if we've been told to sync online for this store or this folder
and we're going offline */
- if (network_state) {
+ network_available =
+ camel_session_get_network_available (service->session);
+
+ if (network_available) {
if (disco_store->status == CAMEL_DISCO_STORE_ONLINE
&& status == CAMEL_DISCO_STORE_OFFLINE) {
if (((CamelStore *)disco_store)->folders) {
@@ -253,7 +256,7 @@ disco_store_set_status (CamelDiscoStore *disco_store,
camel_exception_clear(&x);
}
- if (!camel_service_disconnect (CAMEL_SERVICE (disco_store), network_state, ex))
+ if (!camel_service_disconnect (CAMEL_SERVICE (disco_store), network_available, ex))
return;
disco_store->status = status;
@@ -298,7 +301,7 @@ camel_disco_store_status (CamelDiscoStore *store)
g_return_val_if_fail (CAMEL_IS_DISCO_STORE (store), CAMEL_DISCO_STORE_ONLINE);
if (store->status != CAMEL_DISCO_STORE_OFFLINE
- && !camel_session_is_online (service->session))
+ && !camel_session_get_online (service->session))
store->status = CAMEL_DISCO_STORE_OFFLINE;
return store->status;
@@ -389,7 +392,7 @@ camel_disco_store_prepare_for_offline (CamelDiscoStore *disco_store,
camel_exception_init(&x);
/* Sync the folder fully if we've been told to sync online for this store or this folder */
- if (camel_session_get_network_state (service->session)) {
+ if (camel_session_get_network_available (service->session)) {
if (disco_store->status == CAMEL_DISCO_STORE_ONLINE) {
if (((CamelStore *)disco_store)->folders) {
GPtrArray *folders;
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index f6c64c7..bc06d04 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -784,7 +784,7 @@ info_set_user_flag(CamelMessageInfo *info, const gchar *name, gboolean value)
mi->dirty = TRUE;
camel_folder_summary_touch(mi->summary);
camel_folder_change_info_change_uid(changes, camel_message_info_uid(info));
- camel_object_trigger_event(mi->summary->folder, "folder_changed", changes);
+ camel_folder_changed (mi->summary->folder, changes);
camel_folder_change_info_free(changes);
}
@@ -806,7 +806,7 @@ info_set_user_tag(CamelMessageInfo *info, const gchar *name, const gchar *value)
mi->dirty = TRUE;
camel_folder_summary_touch(mi->summary);
camel_folder_change_info_change_uid(changes, camel_message_info_uid(info));
- camel_object_trigger_event(mi->summary->folder, "folder_changed", changes);
+ camel_folder_changed (mi->summary->folder, changes);
camel_folder_change_info_free(changes);
}
@@ -868,7 +868,7 @@ info_set_flags(CamelMessageInfo *info, guint32 flags, guint32 set)
CamelFolderChangeInfo *changes = camel_folder_change_info_new();
camel_folder_change_info_change_uid(changes, camel_message_info_uid(info));
- camel_object_trigger_event(mi->summary->folder, "folder_changed", changes);
+ camel_folder_changed (mi->summary->folder, changes);
camel_folder_change_info_free(changes);
}
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index e191c40..3af71b4 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -65,6 +65,24 @@ struct _CamelFolderPrivate {
gchar *description;
};
+struct _CamelFolderChangeInfoPrivate {
+ GHashTable *uid_stored; /* what we have stored, which array they're in */
+ GHashTable *uid_source; /* used to create unique lists */
+ GPtrArray *uid_filter; /* uids to be filtered */
+ CamelMemPool *uid_pool; /* pool used to store copies of uid strings */
+};
+
+struct _folder_filter_msg {
+ CamelSessionThreadMsg msg;
+
+ GPtrArray *recents;
+ GPtrArray *junk;
+ GPtrArray *notjunk;
+ CamelFolder *folder;
+ CamelFilterDriver *driver;
+ CamelException ex;
+};
+
enum {
PROP_0,
PROP_DESCRIPTION,
@@ -73,10 +91,155 @@ enum {
PROP_PARENT_STORE
};
+enum {
+ CHANGED,
+ DELETED,
+ RENAMED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL];
+
G_DEFINE_ABSTRACT_TYPE (CamelFolder, camel_folder, CAMEL_TYPE_OBJECT)
-/* Forward Declarations */
-static gboolean folder_changed (CamelObject *object, gpointer event_data);
+static void
+filter_filter (CamelSession *session, CamelSessionThreadMsg *tmsg)
+{
+ struct _folder_filter_msg *m = (struct _folder_filter_msg *) tmsg;
+ CamelMessageInfo *info;
+ CamelStore *parent_store;
+ gint i, status = 0;
+ CamelURL *uri;
+ gchar *source_url;
+ CamelException ex = CAMEL_EXCEPTION_INITIALISER;
+ CamelJunkPlugin *csp;
+ const gchar *full_name;
+
+ full_name = camel_folder_get_full_name (m->folder);
+ parent_store = camel_folder_get_parent_store (m->folder);
+ csp = CAMEL_SERVICE (parent_store)->session->junk_plugin;
+
+ if (m->junk) {
+ /* Translators: The %s is replaced with a folder name where the operation is running. */
+ camel_operation_start (
+ NULL, ngettext (
+ "Learning new spam message in '%s'",
+ "Learning new spam messages in '%s'",
+ m->junk->len), full_name);
+
+ for (i = 0; i < m->junk->len; i ++) {
+ CamelMimeMessage *msg = camel_folder_get_message (m->folder, m->junk->pdata[i], &ex);
+ gint pc = 100 * i / m->junk->len;
+
+ camel_exception_clear (&ex);
+ camel_operation_progress (NULL, pc);
+
+ if (msg) {
+ camel_junk_plugin_report_junk (csp, msg);
+ g_object_unref (msg);
+ }
+ }
+ camel_operation_end (NULL);
+ }
+
+ if (m->notjunk) {
+ /* Translators: The %s is replaced with a folder name where the operation is running. */
+ camel_operation_start (
+ NULL, ngettext (
+ "Learning new ham message in '%s'",
+ "Learning new ham messages in '%s'",
+ m->notjunk->len), full_name);
+ for (i = 0; i < m->notjunk->len; i ++) {
+ CamelMimeMessage *msg = camel_folder_get_message (m->folder, m->notjunk->pdata[i], &ex);
+ gint pc = 100 * i / m->notjunk->len;
+
+ camel_exception_clear (&ex);
+ camel_operation_progress (NULL, pc);
+
+ if (msg) {
+ camel_junk_plugin_report_notjunk (csp, msg);
+ g_object_unref (msg);
+ }
+ }
+ camel_operation_end (NULL);
+ }
+
+ if (m->junk || m->notjunk)
+ camel_junk_plugin_commit_reports (csp);
+
+ if (m->driver && m->recents) {
+ /* Translators: The %s is replaced with a folder name where the operation is running. */
+ camel_operation_start (
+ NULL, ngettext (
+ "Filtering new message in '%s'",
+ "Filtering new messages in '%s'",
+ m->recents->len), full_name);
+
+ source_url = camel_service_get_url (CAMEL_SERVICE (parent_store));
+ uri = camel_url_new (source_url, NULL);
+ g_free (source_url);
+
+ if (full_name != NULL && *full_name != '/') {
+ gchar *tmp;
+
+ tmp = alloca (strlen (full_name) + 2);
+ sprintf (tmp, "/%s", full_name);
+ camel_url_set_path (uri, tmp);
+ } else
+ camel_url_set_path (uri, full_name);
+ source_url = camel_url_to_string (uri, CAMEL_URL_HIDE_ALL);
+ camel_url_free (uri);
+
+ for (i=0;status == 0 && i<m->recents->len;i++) {
+ gchar *uid = m->recents->pdata[i];
+ gint pc = 100 * i / m->recents->len;
+
+ camel_operation_progress (NULL, pc);
+
+ info = camel_folder_get_message_info (m->folder, uid);
+ if (info == NULL) {
+ g_warning ("uid %s vanished from folder: %s", uid, source_url);
+ continue;
+ }
+
+ status = camel_filter_driver_filter_message (m->driver, NULL, info, uid, m->folder, source_url, source_url, &m->ex);
+
+ camel_folder_free_message_info (m->folder, info);
+ }
+
+ camel_filter_driver_flush (m->driver, &ex);
+ if (!camel_exception_is_set (&m->ex))
+ camel_exception_xfer (&m->ex, &ex);
+
+ g_free (source_url);
+
+ camel_operation_end (NULL);
+ }
+}
+
+static void
+filter_free (CamelSession *session, CamelSessionThreadMsg *msg)
+{
+ struct _folder_filter_msg *m = (struct _folder_filter_msg *)msg;
+
+ if (m->driver)
+ g_object_unref (m->driver);
+ if (m->recents)
+ camel_folder_free_deep (m->folder, m->recents);
+ if (m->junk)
+ camel_folder_free_deep (m->folder, m->junk);
+ if (m->notjunk)
+ camel_folder_free_deep (m->folder, m->notjunk);
+
+ camel_folder_summary_save_to_db (m->folder->summary, &m->ex);
+ camel_folder_thaw (m->folder);
+ g_object_unref (m->folder);
+}
+
+static CamelSessionThreadOps filter_ops = {
+ filter_filter,
+ filter_free
+};
static gint
cmp_array_uids (gconstpointer a,
@@ -609,7 +772,7 @@ folder_thaw (CamelFolder * folder)
camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK);
if (info) {
- camel_object_trigger_event (folder, "folder_changed", info);
+ g_signal_emit (folder, signals[CHANGED], 0, info);
camel_folder_change_info_free (info);
}
}
@@ -626,11 +789,97 @@ folder_get_quota_info (CamelFolder *folder)
return NULL;
}
+/* Signal callback that stops emission when folder is frozen. */
+static void
+folder_changed (CamelFolder *folder,
+ CamelFolderChangeInfo *info)
+{
+ CamelStore *parent_store;
+ struct _CamelFolderChangeInfoPrivate *p = info->priv;
+ CamelSession *session;
+ CamelFilterDriver *driver = NULL;
+ GPtrArray *junk = NULL;
+ GPtrArray *notjunk = NULL;
+ GPtrArray *recents = NULL;
+ gint i;
+
+ g_return_if_fail (info != NULL);
+
+ parent_store = camel_folder_get_parent_store (folder);
+ session = CAMEL_SERVICE (parent_store)->session;
+
+ camel_folder_lock (folder, CAMEL_FOLDER_CHANGE_LOCK);
+ if (folder->priv->frozen) {
+ camel_folder_change_info_cat (folder->priv->changed_frozen, info);
+ camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK);
+ g_signal_stop_emission (folder, signals[CHANGED], 0);
+ return;
+ }
+ camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK);
+
+ if (session->junk_plugin && info->uid_changed->len) {
+ guint32 flags;
+
+ for (i = 0; i < info->uid_changed->len; i++) {
+ flags = camel_folder_get_message_flags (folder, info->uid_changed->pdata [i]);
+ if (flags & CAMEL_MESSAGE_JUNK_LEARN) {
+ if (flags & CAMEL_MESSAGE_JUNK) {
+ if (!junk)
+ junk = g_ptr_array_new ();
+ g_ptr_array_add (junk, g_strdup (info->uid_changed->pdata [i]));
+ } else {
+ if (!notjunk)
+ notjunk = g_ptr_array_new ();
+ g_ptr_array_add (notjunk, g_strdup (info->uid_changed->pdata [i]));
+ }
+ /* reset junk learn flag so that we don't process it again*/
+ camel_folder_set_message_flags (folder, info->uid_changed->pdata [i], CAMEL_MESSAGE_JUNK_LEARN, 0);
+ }
+ }
+ }
+
+ if ((folder->folder_flags & (CAMEL_FOLDER_FILTER_RECENT|CAMEL_FOLDER_FILTER_JUNK))
+ && p->uid_filter->len > 0)
+ driver = camel_session_get_filter_driver (session,
+ (folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT)
+ ? "incoming":"junktest", NULL);
+
+ if (driver) {
+ recents = g_ptr_array_new ();
+ for (i = 0; i < p->uid_filter->len; i++)
+ g_ptr_array_add (recents, g_strdup (p->uid_filter->pdata[i]));
+
+ g_ptr_array_set_size (p->uid_filter, 0);
+ }
+
+ if (driver || junk || notjunk) {
+ struct _folder_filter_msg *msg;
+
+ d (printf ("* launching filter thread %d new mail, %d junk and %d not junk\n",
+ recents?recents->len:0, junk?junk->len:0, notjunk?notjunk->len:0));
+
+ msg = camel_session_thread_msg_new (session, &filter_ops, sizeof (*msg));
+ msg->recents = recents;
+ msg->junk = junk;
+ msg->notjunk = notjunk;
+ msg->folder = g_object_ref (folder);
+ camel_folder_freeze (folder);
+ /* Copy changes back to changed_frozen list to retain
+ * them while we are filtering */
+ camel_folder_lock (folder, CAMEL_FOLDER_CHANGE_LOCK);
+ camel_folder_change_info_cat (folder->priv->changed_frozen, info);
+ camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK);
+ msg->driver = driver;
+ camel_exception_init (&msg->ex);
+ camel_session_thread_queue (session, &msg->msg, 0);
+ g_signal_stop_emission (folder, signals[CHANGED], 0);
+ }
+}
+
static void
camel_folder_class_init (CamelFolderClass *class)
{
GObjectClass *object_class;
- CamelObjectClass *camel_object_class;
g_type_class_add_private (class, sizeof (CamelFolderPrivate));
@@ -667,14 +916,7 @@ camel_folder_class_init (CamelFolderClass *class)
class->thaw = folder_thaw;
class->is_frozen = folder_is_frozen;
class->get_quota_info = folder_get_quota_info;
-
- camel_object_class = CAMEL_OBJECT_CLASS (class);
- camel_object_class_add_event (
- camel_object_class, "folder_changed", folder_changed);
- camel_object_class_add_event (
- camel_object_class, "deleted", NULL);
- camel_object_class_add_event (
- camel_object_class, "renamed", NULL);
+ class->changed = folder_changed;
/**
* CamelFolder:description
@@ -739,6 +981,48 @@ camel_folder_class_init (CamelFolderClass *class)
CAMEL_TYPE_STORE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
+
+ /**
+ * CamelFolder::changed
+ * @folder: the #CamelFolder which emitted the signal
+ **/
+ signals[CHANGED] = g_signal_new (
+ "changed",
+ G_OBJECT_CLASS_TYPE (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (CamelFolderClass, changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
+
+ /**
+ * CamelFolder::deleted
+ * @folder: the #CamelFolder which emitted the signal
+ **/
+ signals[DELETED] = g_signal_new (
+ "deleted",
+ G_OBJECT_CLASS_TYPE (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (CamelFolderClass, deleted),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ /**
+ * CamelFolder::renamed
+ * @folder: the #CamelFolder which emitted the signal
+ * @old_name: the previous folder name
+ **/
+ signals[RENAMED] = g_signal_new (
+ "renamed",
+ G_OBJECT_CLASS_TYPE (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (CamelFolderClass, renamed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1,
+ G_TYPE_STRING);
}
static void
@@ -1893,7 +2177,7 @@ camel_folder_delete (CamelFolder *folder)
parent_store = camel_folder_get_parent_store (folder);
camel_db_delete_folder (parent_store->cdb_w, full_name, NULL);
- camel_object_trigger_event (folder, "deleted", NULL);
+ g_signal_emit (folder, signals[DELETED], 0);
}
/**
@@ -1927,12 +2211,29 @@ camel_folder_rename (CamelFolder *folder,
parent_store = camel_folder_get_parent_store (folder);
camel_db_rename_folder (parent_store->cdb_w, old, new, NULL);
- camel_object_trigger_event (folder, "renamed", old);
+ g_signal_emit (folder, signals[RENAMED], 0, old);
g_free (old);
}
/**
+ * camel_folder_changed:
+ * @folder: a #CamelFolder
+ * @changes: change information for @folder
+ *
+ * Emits the #CamelFolder::changed signal.
+ **/
+void
+camel_folder_changed (CamelFolder *folder,
+ CamelFolderChangeInfo *changes)
+{
+ g_return_if_fail (CAMEL_IS_FOLDER (folder));
+ g_return_if_fail (changes != NULL);
+
+ g_signal_emit (folder, signals[CHANGED], 0, changes);
+}
+
+/**
* camel_folder_freeze:
* @folder: a #CamelFolder
*
@@ -2108,263 +2409,6 @@ camel_folder_quota_info_free (CamelFolderQuotaInfo *info)
}
}
-struct _folder_filter_msg {
- CamelSessionThreadMsg msg;
-
- GPtrArray *recents;
- GPtrArray *junk;
- GPtrArray *notjunk;
- CamelFolder *folder;
- CamelFilterDriver *driver;
- CamelException ex;
-};
-
-static void
-filter_filter (CamelSession *session, CamelSessionThreadMsg *tmsg)
-{
- struct _folder_filter_msg *m = (struct _folder_filter_msg *) tmsg;
- CamelMessageInfo *info;
- CamelStore *parent_store;
- gint i, status = 0;
- CamelURL *uri;
- gchar *source_url;
- CamelException ex = CAMEL_EXCEPTION_INITIALISER;
- CamelJunkPlugin *csp;
- const gchar *full_name;
-
- full_name = camel_folder_get_full_name (m->folder);
- parent_store = camel_folder_get_parent_store (m->folder);
- csp = CAMEL_SERVICE (parent_store)->session->junk_plugin;
-
- if (m->junk) {
- /* Translators: The %s is replaced with a folder name where the operation is running. */
- camel_operation_start (
- NULL, ngettext (
- "Learning new spam message in '%s'",
- "Learning new spam messages in '%s'",
- m->junk->len), full_name);
-
- for (i = 0; i < m->junk->len; i ++) {
- CamelMimeMessage *msg = camel_folder_get_message (m->folder, m->junk->pdata[i], &ex);
- gint pc = 100 * i / m->junk->len;
-
- camel_exception_clear (&ex);
- camel_operation_progress (NULL, pc);
-
- if (msg) {
- camel_junk_plugin_report_junk (csp, msg);
- g_object_unref (msg);
- }
- }
- camel_operation_end (NULL);
- }
-
- if (m->notjunk) {
- /* Translators: The %s is replaced with a folder name where the operation is running. */
- camel_operation_start (
- NULL, ngettext (
- "Learning new ham message in '%s'",
- "Learning new ham messages in '%s'",
- m->notjunk->len), full_name);
- for (i = 0; i < m->notjunk->len; i ++) {
- CamelMimeMessage *msg = camel_folder_get_message (m->folder, m->notjunk->pdata[i], &ex);
- gint pc = 100 * i / m->notjunk->len;
-
- camel_exception_clear (&ex);
- camel_operation_progress (NULL, pc);
-
- if (msg) {
- camel_junk_plugin_report_notjunk (csp, msg);
- g_object_unref (msg);
- }
- }
- camel_operation_end (NULL);
- }
-
- if (m->junk || m->notjunk)
- camel_junk_plugin_commit_reports (csp);
-
- if (m->driver && m->recents) {
- /* Translators: The %s is replaced with a folder name where the operation is running. */
- camel_operation_start (
- NULL, ngettext (
- "Filtering new message in '%s'",
- "Filtering new messages in '%s'",
- m->recents->len), full_name);
-
- source_url = camel_service_get_url (CAMEL_SERVICE (parent_store));
- uri = camel_url_new (source_url, NULL);
- g_free (source_url);
-
- if (full_name != NULL && *full_name != '/') {
- gchar *tmp;
-
- tmp = alloca (strlen (full_name) + 2);
- sprintf (tmp, "/%s", full_name);
- camel_url_set_path (uri, tmp);
- } else
- camel_url_set_path (uri, full_name);
- source_url = camel_url_to_string (uri, CAMEL_URL_HIDE_ALL);
- camel_url_free (uri);
-
- for (i=0;status == 0 && i<m->recents->len;i++) {
- gchar *uid = m->recents->pdata[i];
- gint pc = 100 * i / m->recents->len;
-
- camel_operation_progress (NULL, pc);
-
- info = camel_folder_get_message_info (m->folder, uid);
- if (info == NULL) {
- g_warning ("uid %s vanished from folder: %s", uid, source_url);
- continue;
- }
-
- status = camel_filter_driver_filter_message (m->driver, NULL, info, uid, m->folder, source_url, source_url, &m->ex);
-
- camel_folder_free_message_info (m->folder, info);
- }
-
- camel_filter_driver_flush (m->driver, &ex);
- if (!camel_exception_is_set (&m->ex))
- camel_exception_xfer (&m->ex, &ex);
-
- g_free (source_url);
-
- camel_operation_end (NULL);
- }
-}
-
-static void
-filter_free (CamelSession *session, CamelSessionThreadMsg *msg)
-{
- struct _folder_filter_msg *m = (struct _folder_filter_msg *)msg;
-
- if (m->driver)
- g_object_unref (m->driver);
- if (m->recents)
- camel_folder_free_deep (m->folder, m->recents);
- if (m->junk)
- camel_folder_free_deep (m->folder, m->junk);
- if (m->notjunk)
- camel_folder_free_deep (m->folder, m->notjunk);
-
- camel_folder_summary_save_to_db (m->folder->summary, &m->ex);
- camel_folder_thaw (m->folder);
- g_object_unref (m->folder);
-}
-
-static CamelSessionThreadOps filter_ops = {
- filter_filter,
- filter_free
-};
-
-struct _CamelFolderChangeInfoPrivate {
- GHashTable *uid_stored; /* what we have stored, which array they're in */
- GHashTable *uid_source; /* used to create unique lists */
- GPtrArray *uid_filter; /* uids to be filtered */
- CamelMemPool *uid_pool; /* pool used to store copies of uid strings */
-};
-
-/* Event hooks that block emission when frozen */
-static gboolean
-folder_changed (CamelObject *obj, gpointer event_data)
-{
- CamelFolder *folder = (CamelFolder *)obj;
- CamelStore *parent_store;
- CamelFolderChangeInfo *changed = event_data;
- struct _CamelFolderChangeInfoPrivate *p = changed->priv;
- CamelSession *session;
- CamelFilterDriver *driver = NULL;
- GPtrArray *junk = NULL;
- GPtrArray *notjunk = NULL;
- GPtrArray *recents = NULL;
- gint i;
-
- parent_store = camel_folder_get_parent_store (folder);
- session = CAMEL_SERVICE (parent_store)->session;
-
- d (printf ("folder_changed (%p:'%s', %p), frozen=%d\n", obj, folder->full_name, event_data, folder->priv->frozen));
- d (printf (" added %d removed %d changed %d recent %d filter %d\n",
- changed->uid_added->len, changed->uid_removed->len,
- changed->uid_changed->len, changed->uid_recent->len,
- p->uid_filter->len));
-
- if (changed == NULL) {
- w (g_warning ("Class %s is passing NULL to folder_changed event",
- camel_type_to_name (CAMEL_OBJECT_GET_TYPE (folder))));
- return TRUE;
- }
-
- camel_folder_lock (folder, CAMEL_FOLDER_CHANGE_LOCK);
- if (folder->priv->frozen) {
- camel_folder_change_info_cat (folder->priv->changed_frozen, changed);
- camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK);
-
- return FALSE;
- }
- camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK);
-
- if (session->junk_plugin && changed->uid_changed->len) {
- guint32 flags;
-
- for (i = 0; i < changed->uid_changed->len; i++) {
- flags = camel_folder_get_message_flags (folder, changed->uid_changed->pdata [i]);
- if (flags & CAMEL_MESSAGE_JUNK_LEARN) {
- if (flags & CAMEL_MESSAGE_JUNK) {
- if (!junk)
- junk = g_ptr_array_new ();
- g_ptr_array_add (junk, g_strdup (changed->uid_changed->pdata [i]));
- } else {
- if (!notjunk)
- notjunk = g_ptr_array_new ();
- g_ptr_array_add (notjunk, g_strdup (changed->uid_changed->pdata [i]));
- }
- /* reset junk learn flag so that we don't process it again*/
- camel_folder_set_message_flags (folder, changed->uid_changed->pdata [i], CAMEL_MESSAGE_JUNK_LEARN, 0);
- }
- }
- }
-
- if ((folder->folder_flags & (CAMEL_FOLDER_FILTER_RECENT|CAMEL_FOLDER_FILTER_JUNK))
- && p->uid_filter->len > 0)
- driver = camel_session_get_filter_driver (session,
- (folder->folder_flags & CAMEL_FOLDER_FILTER_RECENT)
- ? "incoming":"junktest", NULL);
-
- if (driver) {
- recents = g_ptr_array_new ();
- for (i = 0; i < p->uid_filter->len; i++)
- g_ptr_array_add (recents, g_strdup (p->uid_filter->pdata[i]));
-
- g_ptr_array_set_size (p->uid_filter, 0);
- }
-
- if (driver || junk || notjunk) {
- struct _folder_filter_msg *msg;
-
- d (printf ("* launching filter thread %d new mail, %d junk and %d not junk\n",
- recents?recents->len:0, junk?junk->len:0, notjunk?notjunk->len:0));
-
- msg = camel_session_thread_msg_new (session, &filter_ops, sizeof (*msg));
- msg->recents = recents;
- msg->junk = junk;
- msg->notjunk = notjunk;
- msg->folder = g_object_ref (folder);
- camel_folder_freeze (folder);
- /* Copy changes back to changed_frozen list to retain
- * them while we are filtering */
- camel_folder_lock (folder, CAMEL_FOLDER_CHANGE_LOCK);
- camel_folder_change_info_cat (folder->priv->changed_frozen, changed);
- camel_folder_unlock (folder, CAMEL_FOLDER_CHANGE_LOCK);
- msg->driver = driver;
- camel_exception_init (&msg->ex);
- camel_session_thread_queue (session, &msg->msg, 0);
- return FALSE;
- }
-
- return TRUE;
-}
-
/**
* camel_folder_free_nop:
* @folder: a #CamelFolder
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
index 2f188d8..2c3517c 100644
--- a/camel/camel-folder.h
+++ b/camel/camel-folder.h
@@ -119,6 +119,7 @@ struct _CamelFolder {
struct _CamelFolderClass {
CamelObjectClass parent_class;
+ /* Methods */
gboolean (*refresh_info) (CamelFolder *folder,
CamelException *ex);
gboolean (*sync) (CamelFolder *folder,
@@ -210,6 +211,13 @@ struct _CamelFolderClass {
gchar * (*get_filename) (CamelFolder *folder,
const gchar *uid,
CamelException *ex);
+
+ /* Signals */
+ void (*changed) (CamelFolder *folder,
+ CamelFolderChangeInfo *info);
+ void (*deleted) (CamelFolder *folder);
+ void (*renamed) (CamelFolder *folder,
+ const gchar *old_name);
};
GType camel_folder_get_type (void);
@@ -363,6 +371,8 @@ gboolean camel_folder_transfer_messages_to
void camel_folder_delete (CamelFolder *folder);
void camel_folder_rename (CamelFolder *folder,
const gchar *new);
+void camel_folder_changed (CamelFolder *folder,
+ CamelFolderChangeInfo *changes);
/* stop/restart getting events */
void camel_folder_freeze (CamelFolder *folder);
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
index 18d1430..af1ec59 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -516,7 +516,7 @@ gpg_ctx_get_argv (struct _GpgCtx *gpg, gint status_fd, gchar **sfd, gint passwd_
g_ptr_array_add (argv, (guint8 *) "-");
break;
case GPG_CTX_MODE_VERIFY:
- if (!camel_session_is_online (gpg->session)) {
+ if (!camel_session_get_online (gpg->session)) {
/* this is a deprecated flag to gpg since 1.0.7 */
/*g_ptr_array_add (argv, "--no-auto-key-retrieve");*/
g_ptr_array_add (argv, (guint8 *) "--keyserver-options");
diff --git a/camel/camel-marshal.list b/camel/camel-marshal.list
new file mode 100644
index 0000000..b02c3c0
--- /dev/null
+++ b/camel/camel-marshal.list
@@ -0,0 +1 @@
+NONE:STRING,POINTER
diff --git a/camel/camel-object.c b/camel/camel-object.c
index 020f9d1..26729bb 100644
--- a/camel/camel-object.c
+++ b/camel/camel-object.c
@@ -34,7 +34,6 @@
#include "camel-object.h"
#define d(x)
-#define h(x) /* hooks */
#define CAMEL_OBJECT_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -51,94 +50,8 @@ enum {
G_DEFINE_ABSTRACT_TYPE (CamelObject, camel_object, G_TYPE_OBJECT)
-/* ** Quickie type system ************************************************* */
-
-/* A 'locked' hooklist, that is only allocated on demand */
-typedef struct _CamelHookList {
- GStaticRecMutex lock;
-
- guint depth:30; /* recursive event depth */
- guint flags:2; /* flags, see below */
-
- guint list_length;
- struct _CamelHookPair *list;
-} CamelHookList;
-
-#define CAMEL_HOOK_PAIR_REMOVED (1<<0)
-
-/* a 'hook pair', actually a hook tuple, we just store all hooked events in the same list,
- and just comapre as we go, rather than storing separate lists for each hook type
-
- the name field just points directly to the key field in the class's preplist hashtable.
- This way we can just use a direct pointer compare when scanning it, and also saves
- copying the string */
-typedef struct _CamelHookPair
-{
- struct _CamelHookPair *next; /* next MUST be the first member */
-
- guint id:30;
- guint flags:2; /* removed, etc */
-
- const gchar *name; /* points to the key field in the classes preplist, static memory */
- union {
- CamelObjectEventHookFunc event;
- CamelObjectEventPrepFunc prep;
- gchar *filename;
- } func;
- gpointer data;
-} CamelHookPair;
-
-#define CAMEL_OBJECT_STATE_FILE_MAGIC "CLMD"
-
-/* ********************************************************************** */
-
-static CamelHookList *camel_object_get_hooks(CamelObject *o);
-static void camel_object_free_hooks(CamelObject *o);
-
-#define camel_object_unget_hooks(o) \
- (g_static_rec_mutex_unlock(&CAMEL_OBJECT(o)->hooks->lock))
-
-/* ********************************************************************** */
-
-static struct _CamelHookPair *
-pair_alloc(void)
-{
- static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
- static guint next_id = 1;
- CamelHookPair *pair;
-
- pair = g_slice_new (CamelHookPair);
-
- g_static_mutex_lock (&mutex);
- pair->id = next_id++;
- if (next_id == 0)
- next_id = 1;
- g_static_mutex_unlock (&mutex);
-
- return pair;
-}
-
-static void
-pair_free(CamelHookPair *pair)
-{
- g_slice_free (CamelHookPair, pair);
-}
-
-static struct _CamelHookList *
-hooks_alloc(void)
-{
- return g_slice_new0 (CamelHookList);
-}
-
-static void
-hooks_free(CamelHookList *hooks)
-{
- g_slice_free (CamelHookList, hooks);
-}
-
-/* ************************************************************************ */
-
-/* State file for CamelObject data. Any later versions should only append data.
+/* State file for CamelObject data.
+ Any later versions should only append data.
version:uint32
@@ -154,6 +67,8 @@ hooks_free(CamelHookList *hooks)
*/
+#define CAMEL_OBJECT_STATE_FILE_MAGIC "CLMD"
+
/* XXX This is a holdover from Camel's old homegrown type system.
* CamelArg was a kind of primitive version of GObject properties.
* The argument ID and data type were encoded into a 32-bit integer.
@@ -178,8 +93,56 @@ enum camel_arg_t {
#define CAMEL_ARGV_MAX (20)
+static void
+object_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_STATE_FILENAME:
+ camel_object_set_state_filename (
+ CAMEL_OBJECT (object),
+ g_value_get_string (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+object_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_STATE_FILENAME:
+ g_value_set_string (
+ value, camel_object_get_state_filename (
+ CAMEL_OBJECT (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+object_finalize (GObject *object)
+{
+ CamelObjectPrivate *priv;
+
+ priv = CAMEL_OBJECT_GET_PRIVATE (object);
+
+ g_free (priv->state_filename);
+
+ /* Chain up to parent's finalize() method. */
+ G_OBJECT_CLASS (camel_object_parent_class)->finalize (object);
+}
+
static gint
-cobject_state_read (CamelObject *object, FILE *fp)
+object_state_read (CamelObject *object,
+ FILE *fp)
{
GValue value;
GObjectClass *class;
@@ -291,7 +254,8 @@ exit:
}
static gint
-cobject_state_write (CamelObject *object, FILE *fp)
+object_state_write (CamelObject *object,
+ FILE *fp)
{
GValue value;
GObjectClass *class;
@@ -365,67 +329,6 @@ exit:
}
static void
-object_set_property (GObject *object,
- guint property_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- switch (property_id) {
- case PROP_STATE_FILENAME:
- camel_object_set_state_filename (
- CAMEL_OBJECT (object),
- g_value_get_string (value));
- return;
- }
-
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
-static void
-object_get_property (GObject *object,
- guint property_id,
- GValue *value,
- GParamSpec *pspec)
-{
- switch (property_id) {
- case PROP_STATE_FILENAME:
- g_value_set_string (
- value, camel_object_get_state_filename (
- CAMEL_OBJECT (object)));
- return;
- }
-
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-}
-
-static void
-object_dispose (GObject *object)
-{
- CamelObject *camel_object = CAMEL_OBJECT (object);
-
- if (camel_object->hooks != NULL) {
- camel_object_trigger_event (object, "finalize", NULL);
- camel_object_free_hooks (camel_object);
- }
-
- /* Chain up to parent's dispose() method. */
- G_OBJECT_CLASS (camel_object_parent_class)->dispose (object);
-}
-
-static void
-object_finalize (GObject *object)
-{
- CamelObjectPrivate *priv;
-
- priv = CAMEL_OBJECT_GET_PRIVATE (object);
-
- g_free (priv->state_filename);
-
- /* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (camel_object_parent_class)->finalize (object);
-}
-
-static void
camel_object_class_init (CamelObjectClass *class)
{
GObjectClass *object_class;
@@ -435,15 +338,10 @@ camel_object_class_init (CamelObjectClass *class)
object_class = G_OBJECT_CLASS (class);
object_class->set_property = object_set_property;
object_class->get_property = object_get_property;
- object_class->dispose = object_dispose;
object_class->finalize = object_finalize;
- class->hooks = NULL;
-
- class->state_read = cobject_state_read;
- class->state_write = cobject_state_write;
-
- camel_object_class_add_event (class, "finalize", NULL);
+ class->state_read = object_state_read;
+ class->state_write = object_state_write;
/**
* CamelObject:state-filename
@@ -469,329 +367,6 @@ camel_object_init (CamelObject *object)
object->priv = CAMEL_OBJECT_GET_PRIVATE (object);
}
-static CamelHookPair *
-co_find_pair (CamelObjectClass *class,
- const gchar *name)
-{
- CamelHookPair *hook;
-
- hook = class->hooks;
- while (hook) {
- if (strcmp (hook->name, name) == 0)
- return hook;
- hook = hook->next;
- }
-
- return NULL;
-}
-
-/* class functions */
-void
-camel_object_class_add_event (CamelObjectClass *class,
- const gchar *name,
- CamelObjectEventPrepFunc prep)
-{
- CamelHookPair *pair;
-
- g_return_if_fail (name);
-
- pair = co_find_pair (class, name);
- if (pair) {
- g_warning ("%s: '%s' is already declared for '%s'",
- G_STRFUNC, name, G_OBJECT_CLASS_NAME (class));
- return;
- }
-
- pair = pair_alloc ();
- pair->name = name;
- pair->func.prep = prep;
- pair->flags = 0;
-
- pair->next = class->hooks;
- class->hooks = pair;
-}
-
-/* free hook data */
-static void
-camel_object_free_hooks(CamelObject *o)
-{
- CamelHookPair *pair, *next;
-
- if (o->hooks) {
- g_assert(o->hooks->depth == 0);
- g_assert((o->hooks->flags & CAMEL_HOOK_PAIR_REMOVED) == 0);
-
- pair = o->hooks->list;
- while (pair) {
- next = pair->next;
-
- pair_free(pair);
- pair = next;
- }
- g_static_rec_mutex_free(&o->hooks->lock);
- hooks_free(o->hooks);
- o->hooks = NULL;
- }
-}
-
-/* return (allocate if required) the object's hook list, locking at the same time */
-static CamelHookList *
-camel_object_get_hooks(CamelObject *o)
-{
- static GStaticMutex lock = G_STATIC_MUTEX_INIT;
- CamelHookList *hooks;
-
- /* if we have it, we dont have to do any other locking,
- otherwise use a global lock to setup the object's hook data */
- if (o->hooks == NULL) {
- g_static_mutex_lock(&lock);
- if (o->hooks == NULL) {
- hooks = hooks_alloc();
- g_static_rec_mutex_init(&hooks->lock);
- hooks->flags = 0;
- hooks->depth = 0;
- hooks->list_length = 0;
- hooks->list = NULL;
- o->hooks = hooks;
- }
- g_static_mutex_unlock(&lock);
- }
-
- g_static_rec_mutex_lock(&o->hooks->lock);
-
- return o->hooks;
-}
-
-guint
-camel_object_hook_event (gpointer vo,
- const gchar *name,
- CamelObjectEventHookFunc func,
- gpointer data)
-{
- CamelObject *obj = vo;
- CamelObjectClass *class;
- CamelHookPair *pair, *hook;
- CamelHookList *hooks;
- gint id;
-
- g_return_val_if_fail(CAMEL_IS_OBJECT (obj), 0);
- g_return_val_if_fail(name != NULL, 0);
- g_return_val_if_fail(func != NULL, 0);
-
- class = CAMEL_OBJECT_GET_CLASS (obj);
-
- hook = co_find_pair(class, name);
-
- /* Check all interfaces on this object for events defined on them */
- if (hook == NULL) {
- g_warning("camel_object_hook_event: trying to hook event '%s' in class '%s' with no defined events.",
- name, G_OBJECT_CLASS_NAME (class));
-
- return 0;
- }
-
- /* setup hook pair */
- pair = pair_alloc();
- pair->name = hook->name; /* effectively static! */
- pair->func.event = func;
- pair->data = data;
- pair->flags = 0;
- id = pair->id;
-
- /* get the hook list object, locked, link in new event hook, unlock */
- hooks = camel_object_get_hooks(obj);
- pair->next = hooks->list;
- hooks->list = pair;
- hooks->list_length++;
- camel_object_unget_hooks(obj);
-
- h(printf("%p hook event '%s' %p %p = %d\n", vo, name, func, data, id));
-
- return id;
-}
-
-void
-camel_object_remove_event (gpointer vo,
- guint id)
-{
- CamelObject *obj = vo;
- CamelHookList *hooks;
- CamelHookPair *pair, *parent;
-
- g_return_if_fail (CAMEL_IS_OBJECT (obj));
- g_return_if_fail (id != 0);
-
- if (obj->hooks == NULL) {
- g_warning("camel_object_unhook_event: trying to unhook '%u' from an instance of '%s' with no hooks",
- id, G_OBJECT_TYPE_NAME (obj));
- return;
- }
-
- h(printf("%p remove event %d\n", vo, id));
-
- /* scan hooks for this event, remove it, or flag it if we're busy */
- hooks = camel_object_get_hooks(obj);
- parent = (CamelHookPair *)&hooks->list;
- pair = parent->next;
- while (pair) {
- if (pair->id == id
- && (pair->flags & CAMEL_HOOK_PAIR_REMOVED) == 0) {
- if (hooks->depth > 0) {
- pair->flags |= CAMEL_HOOK_PAIR_REMOVED;
- hooks->flags |= CAMEL_HOOK_PAIR_REMOVED;
- } else {
- parent->next = pair->next;
- pair_free(pair);
- hooks->list_length--;
- }
- camel_object_unget_hooks(obj);
- return;
- }
- parent = pair;
- pair = pair->next;
- }
- camel_object_unget_hooks(obj);
-
- g_warning("camel_object_unhook_event: cannot find hook id %u in instance of '%s'",
- id, G_OBJECT_TYPE_NAME (obj));
-}
-
-void
-camel_object_unhook_event (gpointer vo,
- const gchar *name,
- CamelObjectEventHookFunc func,
- gpointer data)
-{
- CamelObject *obj = vo;
- CamelHookList *hooks;
- CamelHookPair *pair, *parent;
-
- g_return_if_fail (CAMEL_IS_OBJECT (obj));
- g_return_if_fail (name != NULL);
- g_return_if_fail (func != NULL);
-
- if (obj->hooks == NULL) {
- g_warning("camel_object_unhook_event: trying to unhook '%s' from an instance of '%s' with no hooks",
- name, G_OBJECT_TYPE_NAME (obj));
- return;
- }
-
- h(printf("%p unhook event '%s' %p %p\n", vo, name, func, data));
-
- /* scan hooks for this event, remove it, or flag it if we're busy */
- hooks = camel_object_get_hooks(obj);
- parent = (CamelHookPair *)&hooks->list;
- pair = parent->next;
- while (pair) {
- if (pair->func.event == func
- && pair->data == data
- && strcmp(pair->name, name) == 0
- && (pair->flags & CAMEL_HOOK_PAIR_REMOVED) == 0) {
- if (hooks->depth > 0) {
- pair->flags |= CAMEL_HOOK_PAIR_REMOVED;
- hooks->flags |= CAMEL_HOOK_PAIR_REMOVED;
- } else {
- parent->next = pair->next;
- pair_free(pair);
- hooks->list_length--;
- }
- camel_object_unget_hooks(obj);
- return;
- }
- parent = pair;
- pair = pair->next;
- }
- camel_object_unget_hooks(obj);
-
- g_warning("camel_object_unhook_event: cannot find hook/data pair %p/%p in an instance of '%s' attached to '%s'",
- (gpointer) func, data, G_OBJECT_TYPE_NAME (obj), name);
-}
-
-void
-camel_object_trigger_event (gpointer vo,
- const gchar *name,
- gpointer event_data)
-{
- CamelObject *obj = vo;
- CamelObjectClass *class;
- CamelHookList *hooks;
- CamelHookPair *pair, **pairs, *parent, *hook;
- gint i, size;
- const gchar *prepname;
-
- g_return_if_fail (CAMEL_IS_OBJECT (obj));
- g_return_if_fail (name);
-
- class = CAMEL_OBJECT_GET_CLASS (obj);
-
- hook = co_find_pair(class, name);
- if (hook)
- goto trigger;
-
- if (obj->hooks == NULL)
- return;
-
- g_warning("camel_object_trigger_event: trying to trigger unknown event '%s' in class '%s'",
- name, G_OBJECT_TYPE_NAME (obj));
-
- return;
-
-trigger:
- /* try prep function, if false, then quit */
- if (hook->func.prep != NULL && !hook->func.prep(obj, event_data))
- return;
-
- /* also, no hooks, dont bother going further */
- if (obj->hooks == NULL)
- return;
-
- /* lock the object for hook emission */
- g_object_ref(obj);
- hooks = camel_object_get_hooks(obj);
-
- if (hooks->list) {
- /* first, copy the items in the list, and say we're in an event */
- hooks->depth++;
- pair = hooks->list;
- size = 0;
- pairs = alloca(sizeof(pairs[0]) * hooks->list_length);
- prepname = hook->name;
- while (pair) {
- if (pair->name == prepname)
- pairs[size++] = pair;
- pair = pair->next;
- }
-
- /* now execute the events we have, if they haven't been removed during our calls */
- for (i=size-1;i>=0;i--) {
- pair = pairs[i];
- if ((pair->flags & CAMEL_HOOK_PAIR_REMOVED) == 0)
- (pair->func.event) (obj, event_data, pair->data);
- }
- hooks->depth--;
-
- /* and if we're out of any events, then clean up any pending removes */
- if (hooks->depth == 0 && (hooks->flags & CAMEL_HOOK_PAIR_REMOVED)) {
- parent = (CamelHookPair *)&hooks->list;
- pair = parent->next;
- while (pair) {
- if (pair->flags & CAMEL_HOOK_PAIR_REMOVED) {
- parent->next = pair->next;
- pair_free(pair);
- hooks->list_length--;
- } else {
- parent = pair;
- }
- pair = parent->next;
- }
- hooks->flags &= ~CAMEL_HOOK_PAIR_REMOVED;
- }
- }
-
- camel_object_unget_hooks(obj);
- g_object_unref(obj);
-}
-
/**
* camel_object_state_read:
* @object: a #CamelObject
diff --git a/camel/camel-object.h b/camel/camel-object.h
index d90a224..0dbe294 100644
--- a/camel/camel-object.h
+++ b/camel/camel-object.h
@@ -34,8 +34,6 @@
#include <stdlib.h> /* gsize */
#include <stdarg.h>
-#include <camel/camel-exception.h>
-
/* Standard GObject macros */
#define CAMEL_TYPE_OBJECT \
(camel_object_get_type ())
@@ -61,11 +59,6 @@ typedef struct _CamelObject CamelObject;
typedef struct _CamelObjectClass CamelObjectClass;
typedef struct _CamelObjectPrivate CamelObjectPrivate;
-typedef guint CamelObjectHookID;
-
-typedef gboolean (*CamelObjectEventPrepFunc) (CamelObject *, gpointer);
-typedef void (*CamelObjectEventHookFunc) (CamelObject *, gpointer, gpointer);
-
/**
* CamelParamFlags:
* @CAMEL_PARAM_PERSISTENT:
@@ -85,36 +78,20 @@ typedef enum {
struct _CamelObject {
GObject parent;
CamelObjectPrivate *priv;
-
- /* current hooks on this object */
- struct _CamelHookList *hooks;
};
struct _CamelObjectClass {
GObjectClass parent_class;
- /* available hooks for this class */
- struct _CamelHookPair *hooks;
-
- /* persistence stuff */
- gint (*state_read)(CamelObject *, FILE *fp);
- gint (*state_write)(CamelObject *, FILE *fp);
+ gint (*state_read) (CamelObject *object,
+ FILE *fp);
+ gint (*state_write) (CamelObject *object,
+ FILE *fp);
};
-void camel_object_class_add_event (CamelObjectClass *klass, const gchar *name, CamelObjectEventPrepFunc prep);
-
-GType camel_object_get_type (void);
-
-/* hooks */
-CamelObjectHookID camel_object_hook_event(gpointer obj, const gchar *name, CamelObjectEventHookFunc hook, gpointer data);
-void camel_object_remove_event(gpointer obj, CamelObjectHookID id);
-void camel_object_unhook_event(gpointer obj, const gchar *name, CamelObjectEventHookFunc hook, gpointer data);
-void camel_object_trigger_event(gpointer obj, const gchar *name, gpointer event_data);
-
-/* reads/writes the state from/to the CAMEL_OBJECT_STATE_FILE */
+GType camel_object_get_type (void);
gint camel_object_state_read (CamelObject *object);
gint camel_object_state_write (CamelObject *object);
-
const gchar * camel_object_get_state_filename (CamelObject *object);
void camel_object_set_state_filename (CamelObject *object,
const gchar *state_filename);
diff --git a/camel/camel-offline-folder.c b/camel/camel-offline-folder.c
index 6918ad3..c08a25b 100644
--- a/camel/camel-offline-folder.c
+++ b/camel/camel-offline-folder.c
@@ -97,7 +97,8 @@ static CamelSessionThreadOps offline_downsync_ops = {
};
static void
-offline_folder_changed (CamelFolder *folder, CamelFolderChangeInfo *changes, gpointer dummy)
+offline_folder_changed (CamelFolder *folder,
+ CamelFolderChangeInfo *changes)
{
CamelStore *parent_store;
CamelService *service;
@@ -232,9 +233,9 @@ camel_offline_folder_init (CamelOfflineFolder *folder)
{
folder->priv = CAMEL_OFFLINE_FOLDER_GET_PRIVATE (folder);
- camel_object_hook_event (
- folder, "folder_changed",
- (CamelObjectEventHookFunc) offline_folder_changed, NULL);
+ g_signal_connect (
+ folder, "changed",
+ G_CALLBACK (offline_folder_changed), NULL);
}
/**
diff --git a/camel/camel-offline-store.c b/camel/camel-offline-store.c
index bb0a892..d2425d8 100644
--- a/camel/camel-offline-store.c
+++ b/camel/camel-offline-store.c
@@ -48,7 +48,7 @@ offline_store_construct (CamelService *service,
if (!service_class->construct (service, session, provider, url, ex))
return FALSE;
- store->state = camel_session_is_online (session) ?
+ store->state = camel_session_get_online (session) ?
CAMEL_OFFLINE_STORE_NETWORK_AVAIL :
CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL;
@@ -103,15 +103,18 @@ camel_offline_store_set_network_state (CamelOfflineStore *store,
{
CamelException lex;
CamelService *service = CAMEL_SERVICE (store);
- gboolean network_state = camel_session_get_network_state (service->session);
+ gboolean network_available;
if (store->state == state)
return TRUE;
+ network_available =
+ camel_session_get_network_available (service->session);
+
camel_exception_init (&lex);
if (store->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) {
/* network available -> network unavailable */
- if (network_state) {
+ if (network_available) {
if (((CamelStore *) store)->folders) {
GPtrArray *folders;
CamelFolder *folder;
@@ -139,7 +142,7 @@ camel_offline_store_set_network_state (CamelOfflineStore *store,
camel_exception_clear (&lex);
}
- if (!camel_service_disconnect (CAMEL_SERVICE (store), network_state, ex))
+ if (!camel_service_disconnect (CAMEL_SERVICE (store), network_available, ex))
return FALSE;
} else {
store->state = state;
@@ -166,10 +169,12 @@ camel_offline_store_prepare_for_offline (CamelOfflineStore *store,
{
CamelException lex;
CamelService *service = CAMEL_SERVICE (store);
- gboolean network_state = camel_session_get_network_state (service->session);
+ gboolean network_available;
+
+ network_available = camel_session_get_network_available (service->session);
camel_exception_init (&lex);
- if (network_state) {
+ if (network_available) {
if (store->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) {
if (((CamelStore *) store)->folders) {
GPtrArray *folders;
diff --git a/camel/camel-session.c b/camel/camel-session.c
index 1f9a8da..a091873 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -63,6 +63,18 @@ struct _CamelSessionPrivate {
GHashTable *thread_msg_op;
GHashTable *junk_headers;
+
+ guint check_junk : 1;
+ guint network_available : 1;
+ guint online : 1;
+};
+
+enum {
+ PROP_0,
+ PROP_CHECK_JUNK,
+ PROP_NETWORK_AVAILABLE,
+ PROP_ONLINE,
+ PROP_STORAGE_PATH
};
G_DEFINE_TYPE (CamelSession, camel_session, CAMEL_TYPE_OBJECT)
@@ -83,6 +95,64 @@ cs_thread_status (CamelOperation *op,
}
static void
+session_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_CHECK_JUNK:
+ camel_session_set_check_junk (
+ CAMEL_SESSION (object),
+ g_value_get_boolean (value));
+ return;
+
+ case PROP_NETWORK_AVAILABLE:
+ camel_session_set_network_available (
+ CAMEL_SESSION (object),
+ g_value_get_boolean (value));
+ return;
+
+ case PROP_ONLINE:
+ camel_session_set_online (
+ CAMEL_SESSION (object),
+ g_value_get_boolean (value));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+session_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (property_id) {
+ case PROP_CHECK_JUNK:
+ g_value_set_boolean (
+ value, camel_session_get_check_junk (
+ CAMEL_SESSION (object)));
+ return;
+
+ case PROP_NETWORK_AVAILABLE:
+ g_value_set_boolean (
+ value, camel_session_get_network_available (
+ CAMEL_SESSION (object)));
+ return;
+
+ case PROP_ONLINE:
+ g_value_set_boolean (
+ value, camel_session_get_online (
+ CAMEL_SESSION (object)));
+ return;
+ }
+
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
session_finalize (GObject *object)
{
CamelSession *session = CAMEL_SESSION (object);
@@ -306,11 +376,12 @@ static void
camel_session_class_init (CamelSessionClass *class)
{
GObjectClass *object_class;
- CamelObjectClass *camel_object_class;
g_type_class_add_private (class, sizeof (CamelSessionPrivate));
object_class = G_OBJECT_CLASS (class);
+ object_class->set_property = session_set_property;
+ object_class->get_property = session_get_property;
object_class->finalize = session_finalize;
class->get_service = session_get_service;
@@ -321,8 +392,38 @@ camel_session_class_init (CamelSessionClass *class)
class->thread_wait = session_thread_wait;
class->thread_status = session_thread_status;
- camel_object_class = CAMEL_OBJECT_CLASS (class);
- camel_object_class_add_event (camel_object_class, "online", NULL);
+ g_object_class_install_property (
+ object_class,
+ PROP_CHECK_JUNK,
+ g_param_spec_boolean (
+ "check-junk",
+ "Check Junk",
+ "Check incoming messages for junk",
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_NETWORK_AVAILABLE,
+ g_param_spec_boolean (
+ "network-available",
+ "Network Available",
+ "Whether the network is available",
+ TRUE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_ONLINE,
+ g_param_spec_boolean (
+ "online",
+ "Online",
+ "Whether the shell is online",
+ TRUE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
}
static void
@@ -330,9 +431,6 @@ camel_session_init (CamelSession *session)
{
session->priv = CAMEL_SESSION_GET_PRIVATE (session);
- session->online = TRUE;
- session->network_state = TRUE;
-
session->priv->lock = g_mutex_new();
session->priv->thread_lock = g_mutex_new();
session->priv->thread_id = 1;
@@ -652,30 +750,35 @@ camel_session_build_password_prompt (const gchar *type,
}
/**
- * camel_session_is_online:
- * @session: a #CamelSession object
+ * camel_session_get_online:
+ * @session: a #CamelSession
*
* Returns: whether or not @session is online
**/
gboolean
-camel_session_is_online (CamelSession *session)
+camel_session_get_online (CamelSession *session)
{
- return session->online;
+ g_return_val_if_fail (CAMEL_IS_SESSION (session), FALSE);
+
+ return session->priv->online;
}
/**
* camel_session_set_online:
- * @session: a #CamelSession object
+ * @session: a #CamelSession
* @online: whether or not the session should be online
*
* Sets the online status of @session to @online.
**/
void
-camel_session_set_online (CamelSession *session, gboolean online)
+camel_session_set_online (CamelSession *session,
+ gboolean online)
{
- session->online = online;
+ g_return_if_fail (CAMEL_IS_SESSION (session));
- camel_object_trigger_event(session, "online", GINT_TO_POINTER(online));
+ session->priv->online = online;
+
+ g_object_notify (G_OBJECT (session), "online");
}
/**
@@ -809,25 +912,25 @@ camel_session_thread_wait (CamelSession *session,
}
/**
- * camel_session_check_junk:
- * @session: a #CamelSession object
+ * camel_session_get_check_junk:
+ * @session: a #CamelSession
*
* Do we have to check incoming messages to be junk?
*
* Returns: whether or not we are checking incoming messages for junk
**/
gboolean
-camel_session_check_junk (CamelSession *session)
+camel_session_get_check_junk (CamelSession *session)
{
g_return_val_if_fail (CAMEL_IS_SESSION (session), FALSE);
- return session->check_junk;
+ return session->priv->check_junk;
}
/**
* camel_session_set_check_junk:
- * @session: a #CamelSession object
- * @check_junk: state
+ * @session: a #CamelSession
+ * @check_junk: whether to check incoming messages for junk
*
* Set check_junk flag, if set, incoming mail will be checked for being junk.
**/
@@ -837,24 +940,41 @@ camel_session_set_check_junk (CamelSession *session,
{
g_return_if_fail (CAMEL_IS_SESSION (session));
- session->check_junk = check_junk;
+ session->priv->check_junk = check_junk;
+
+ g_object_notify (G_OBJECT (session), "check-junk");
}
+/**
+ * camel_session_get_network_available:
+ * @session: a #CamelSession
+ *
+ * Since: 3.0
+ **/
gboolean
-camel_session_get_network_state (CamelSession *session)
+camel_session_get_network_available (CamelSession *session)
{
g_return_val_if_fail (CAMEL_IS_SESSION (session), FALSE);
- return session->network_state;
+ return session->priv->network_available;
}
+/**
+ * camel_session_set_network_available:
+ * @session: a #CamelSession
+ * @network_available: whether a network is available
+ *
+ * Since: 3.0
+ **/
void
-camel_session_set_network_state (CamelSession *session,
- gboolean network_state)
+camel_session_set_network_available (CamelSession *session,
+ gboolean network_available)
{
g_return_if_fail (CAMEL_IS_SESSION (session));
- session->network_state = network_state;
+ session->priv->network_available = network_available;
+
+ g_object_notify (G_OBJECT (session), "network-available");
}
/**
diff --git a/camel/camel-session.h b/camel/camel-session.h
index 3c7a12d..76c7f60 100644
--- a/camel/camel-session.h
+++ b/camel/camel-session.h
@@ -91,10 +91,6 @@ struct _CamelSession {
gchar *storage_path;
CamelJunkPlugin *junk_plugin;
-
- guint online:1;
- guint check_junk:1;
- guint network_state:1;
};
typedef struct _CamelSessionThreadOps CamelSessionThreadOps;
@@ -103,72 +99,71 @@ typedef struct _CamelSessionThreadMsg CamelSessionThreadMsg;
struct _CamelSessionClass {
CamelObjectClass parent_class;
- CamelService * (*get_service) (CamelSession *session,
- const gchar *url_string,
- CamelProviderType type,
- CamelException *ex);
- gchar * (*get_storage_path) (CamelSession *session,
- CamelService *service,
- CamelException *ex);
-
- gchar * (*get_password) (CamelSession *session,
- CamelService *service,
- const gchar *domain,
- const gchar *prompt,
- const gchar *item,
- guint32 flags,
- CamelException *ex);
- gboolean (*forget_password) (CamelSession *session,
- CamelService *service,
- const gchar *domain,
- const gchar *item,
- CamelException *ex);
- gboolean (*alert_user) (CamelSession *session,
- CamelSessionAlertType type,
- const gchar *prompt,
- gboolean cancel);
-
- CamelFilterDriver * (*get_filter_driver) (CamelSession *session,
- const gchar *type,
- CamelException *ex);
+ CamelService * (*get_service) (CamelSession *session,
+ const gchar *url_string,
+ CamelProviderType type,
+ CamelException *ex);
+ gchar * (*get_storage_path) (CamelSession *session,
+ CamelService *service,
+ CamelException *ex);
+ gchar * (*get_password) (CamelSession *session,
+ CamelService *service,
+ const gchar *domain,
+ const gchar *prompt,
+ const gchar *item,
+ guint32 flags,
+ CamelException *ex);
+ gboolean (*forget_password) (CamelSession *session,
+ CamelService *service,
+ const gchar *domain,
+ const gchar *item,
+ CamelException *ex);
+ gboolean (*alert_user) (CamelSession *session,
+ CamelSessionAlertType type,
+ const gchar *prompt,
+ gboolean cancel);
+ CamelFilterDriver *
+ (*get_filter_driver) (CamelSession *session,
+ const gchar *type,
+ CamelException *ex);
/* mechanism for creating and maintaining multiple threads of control */
- gpointer (*thread_msg_new) (CamelSession *session,
- CamelSessionThreadOps *ops,
- guint size);
- void (*thread_msg_free) (CamelSession *session,
- CamelSessionThreadMsg *msg);
- gint (*thread_queue) (CamelSession *session,
- CamelSessionThreadMsg *msg,
- gint flags);
- void (*thread_wait) (CamelSession *session,
- gint id);
- void (*thread_status) (CamelSession *session,
- CamelSessionThreadMsg *msg,
- const gchar *text,
- gint pc);
- gboolean (*lookup_addressbook)(CamelSession *session,
- const gchar *name);
- void (*forward_to) (CamelSession *session,
- CamelFolder *folder,
- CamelMimeMessage *message,
- const gchar *address,
- CamelException *ex);
+ gpointer (*thread_msg_new) (CamelSession *session,
+ CamelSessionThreadOps *ops,
+ guint size);
+ void (*thread_msg_free) (CamelSession *session,
+ CamelSessionThreadMsg *msg);
+ gint (*thread_queue) (CamelSession *session,
+ CamelSessionThreadMsg *msg,
+ gint flags);
+ void (*thread_wait) (CamelSession *session,
+ gint id);
+ void (*thread_status) (CamelSession *session,
+ CamelSessionThreadMsg *msg,
+ const gchar *text,
+ gint pc);
+
+ gboolean (*lookup_addressbook) (CamelSession *session,
+ const gchar *name);
+ void (*forward_to) (CamelSession *session,
+ CamelFolder *folder,
+ CamelMimeMessage *message,
+ const gchar *address,
+ CamelException *ex);
};
-GType camel_session_get_type (void);
-
-void camel_session_construct (CamelSession *session,
- const gchar *storage_path);
-
-CamelService * camel_session_get_service (CamelSession *session,
- const gchar *url_string,
- CamelProviderType type,
- CamelException *ex);
-CamelService * camel_session_get_service_connected (CamelSession *session,
- const gchar *url_string,
- CamelProviderType type,
- CamelException *ex);
+GType camel_session_get_type (void);
+void camel_session_construct (CamelSession *session,
+ const gchar *storage_path);
+CamelService * camel_session_get_service (CamelSession *session,
+ const gchar *url_string,
+ CamelProviderType type,
+ CamelException *ex);
+CamelService * camel_session_get_service_connected
+ (CamelSession *session,
+ const gchar *url_string,
+ CamelProviderType type,
+ CamelException *ex);
#define camel_session_get_store(session, url_string, ex) \
((CamelStore *) camel_session_get_service_connected \
@@ -177,43 +172,39 @@ CamelService * camel_session_get_service_connected (CamelSession *session,
((CamelTransport *) camel_session_get_service_connected \
(session, url_string, CAMEL_PROVIDER_TRANSPORT, ex))
-gchar * camel_session_get_storage_path (CamelSession *session,
- CamelService *service,
- CamelException *ex);
-
-gchar * camel_session_get_password (CamelSession *session,
- CamelService *service,
- const gchar *domain,
- const gchar *prompt,
- const gchar *item,
- guint32 flags,
- CamelException *ex);
-gboolean camel_session_forget_password (CamelSession *session,
- CamelService *service,
- const gchar *domain,
- const gchar *item,
- CamelException *ex);
-gboolean camel_session_alert_user (CamelSession *session,
- CamelSessionAlertType type,
- const gchar *prompt,
- gboolean cancel);
-
-gchar * camel_session_build_password_prompt
- (const gchar *type,
- const gchar *user,
- const gchar *host);
-
-gboolean camel_session_is_online (CamelSession *session);
-void camel_session_set_online (CamelSession *session,
- gboolean online);
-
-CamelFilterDriver *camel_session_get_filter_driver (CamelSession *session,
- const gchar *type,
- CamelException *ex);
-
-gboolean camel_session_check_junk (CamelSession *session);
-void camel_session_set_check_junk (CamelSession *session,
- gboolean check_junk);
+gchar * camel_session_get_storage_path (CamelSession *session,
+ CamelService *service,
+ CamelException *ex);
+gchar * camel_session_get_password (CamelSession *session,
+ CamelService *service,
+ const gchar *domain,
+ const gchar *prompt,
+ const gchar *item,
+ guint32 flags,
+ CamelException *ex);
+gboolean camel_session_forget_password (CamelSession *session,
+ CamelService *service,
+ const gchar *domain,
+ const gchar *item,
+ CamelException *ex);
+gboolean camel_session_alert_user (CamelSession *session,
+ CamelSessionAlertType type,
+ const gchar *prompt,
+ gboolean cancel);
+gchar * camel_session_build_password_prompt
+ (const gchar *type,
+ const gchar *user,
+ const gchar *host);
+gboolean camel_session_get_online (CamelSession *session);
+void camel_session_set_online (CamelSession *session,
+ gboolean online);
+CamelFilterDriver *
+ camel_session_get_filter_driver (CamelSession *session,
+ const gchar *type,
+ CamelException *ex);
+gboolean camel_session_get_check_junk (CamelSession *session);
+void camel_session_set_check_junk (CamelSession *session,
+ gboolean check_junk);
struct _CamelSessionThreadOps {
void (*receive)(CamelSession *session, CamelSessionThreadMsg *m);
@@ -230,36 +221,40 @@ struct _CamelSessionThreadMsg {
CamelOperation *op;
CamelSession *session;
- gpointer data; /* free for implementation to define, not used by camel, do not use in client code */
+ gpointer data; /* Free for implementation to define, not
+ * used by Camel, do not use in client code. */
+
/* user fields follow */
};
-gpointer camel_session_thread_msg_new (CamelSession *session,
- CamelSessionThreadOps *ops,
- guint size);
-void camel_session_thread_msg_free (CamelSession *session,
- CamelSessionThreadMsg *msg);
-gint camel_session_thread_queue (CamelSession *session,
- CamelSessionThreadMsg *msg,
- gint flags);
-void camel_session_thread_wait (CamelSession *session,
- gint id);
-gboolean camel_session_get_network_state (CamelSession *session);
-void camel_session_set_network_state (CamelSession *session,
- gboolean network_state);
-const GHashTable * camel_session_get_junk_headers (CamelSession *session);
-void camel_session_set_junk_headers (CamelSession *session,
- const gchar **headers,
- const gchar **values,
- gint len);
-gboolean camel_session_lookup_addressbook (CamelSession *session,
- const gchar *name);
-
-void camel_session_forward_to (CamelSession *session,
- CamelFolder *folder,
- CamelMimeMessage *message,
- const gchar *address,
- CamelException *ex);
+gpointer camel_session_thread_msg_new (CamelSession *session,
+ CamelSessionThreadOps *ops,
+ guint size);
+void camel_session_thread_msg_free (CamelSession *session,
+ CamelSessionThreadMsg *msg);
+gint camel_session_thread_queue (CamelSession *session,
+ CamelSessionThreadMsg *msg,
+ gint flags);
+void camel_session_thread_wait (CamelSession *session,
+ gint id);
+gboolean camel_session_get_network_available
+ (CamelSession *session);
+void camel_session_set_network_available
+ (CamelSession *session,
+ gboolean network_state);
+const GHashTable *
+ camel_session_get_junk_headers (CamelSession *session);
+void camel_session_set_junk_headers (CamelSession *session,
+ const gchar **headers,
+ const gchar **values,
+ gint len);
+gboolean camel_session_lookup_addressbook(CamelSession *session,
+ const gchar *name);
+void camel_session_forward_to (CamelSession *session,
+ CamelFolder *folder,
+ CamelMimeMessage *message,
+ const gchar *address,
+ CamelException *ex);
void camel_session_lock (CamelSession *session,
CamelSessionLock lock);
void camel_session_unlock (CamelSession *session,
diff --git a/camel/camel-store.c b/camel/camel-store.c
index a08e725..7b3a821 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -37,6 +37,7 @@
#include "camel-debug.h"
#include "camel-exception.h"
#include "camel-folder.h"
+#include "camel-marshal.h"
#include "camel-session.h"
#include "camel-store.h"
#include "camel-vtrash-folder.h"
@@ -52,6 +53,18 @@ struct _CamelStorePrivate {
GStaticRecMutex folder_lock; /* for locking folder operations */
};
+enum {
+ FOLDER_CREATED,
+ FOLDER_DELETED,
+ FOLDER_OPENED,
+ FOLDER_RENAMED,
+ FOLDER_SUBSCRIBED,
+ FOLDER_UNSUBSCRIBED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL];
+
G_DEFINE_ABSTRACT_TYPE (CamelStore, camel_store, CAMEL_TYPE_SERVICE)
/**
@@ -281,7 +294,6 @@ static void
camel_store_class_init (CamelStoreClass *class)
{
GObjectClass *object_class;
- CamelObjectClass *camel_object_class;
CamelServiceClass *service_class;
g_type_class_add_private (class, sizeof (CamelStorePrivate));
@@ -302,13 +314,66 @@ camel_store_class_init (CamelStoreClass *class)
class->noop = store_noop;
class->can_refresh_folder = store_can_refresh_folder;
- camel_object_class = CAMEL_OBJECT_CLASS (class);
- camel_object_class_add_event(camel_object_class, "folder_opened", NULL);
- camel_object_class_add_event(camel_object_class, "folder_created", NULL);
- camel_object_class_add_event(camel_object_class, "folder_deleted", NULL);
- camel_object_class_add_event(camel_object_class, "folder_renamed", NULL);
- camel_object_class_add_event(camel_object_class, "folder_subscribed", NULL);
- camel_object_class_add_event(camel_object_class, "folder_unsubscribed", NULL);
+ signals[FOLDER_CREATED] = g_signal_new (
+ "folder-created",
+ G_OBJECT_CLASS_TYPE (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (CamelStoreClass, folder_created),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
+
+ signals[FOLDER_DELETED] = g_signal_new (
+ "folder-deleted",
+ G_OBJECT_CLASS_TYPE (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (CamelStoreClass, folder_deleted),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
+
+ signals[FOLDER_OPENED] = g_signal_new (
+ "folder-opened",
+ G_OBJECT_CLASS_TYPE (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (CamelStoreClass, folder_opened),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ CAMEL_TYPE_FOLDER);
+
+ signals[FOLDER_RENAMED] = g_signal_new (
+ "folder-renamed",
+ G_OBJECT_CLASS_TYPE (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (CamelStoreClass, folder_renamed),
+ NULL, NULL,
+ camel_marshal_VOID__STRING_POINTER,
+ G_TYPE_NONE, 2,
+ G_TYPE_STRING,
+ G_TYPE_POINTER);
+
+ signals[FOLDER_SUBSCRIBED] = g_signal_new (
+ "folder-subscribed",
+ G_OBJECT_CLASS_TYPE (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (CamelStoreClass, folder_subscribed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
+
+ signals[FOLDER_UNSUBSCRIBED] = g_signal_new (
+ "folder-unsubscribed",
+ G_OBJECT_CLASS_TYPE (class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (CamelStoreClass, folder_unsubscribed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
}
static void
@@ -413,7 +478,7 @@ camel_store_get_folder (CamelStore *store,
}
if (folder)
- camel_object_trigger_event(store, "folder_opened", folder);
+ g_signal_emit (store, signals[FOLDER_OPENED], 0, folder);
}
return folder;
@@ -623,14 +688,14 @@ camel_store_rename_folder (CamelStore *store,
}
}
- /* Now try the real rename (will emit renamed event) */
+ /* Now try the real rename (will emit renamed signal) */
success = class->rename_folder (store, old_name, new_name, ex);
/* If it worked, update all open folders/unlock them */
if (folders) {
if (success) {
guint32 flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE;
- CamelRenameInfo reninfo;
+ CamelFolderInfo *folder_info;
for (i=0;i<folders->len;i++) {
const gchar *full_name;
@@ -652,11 +717,10 @@ camel_store_rename_folder (CamelStore *store,
if (store->flags & CAMEL_STORE_SUBSCRIPTIONS)
flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
- reninfo.old_base = (gchar *)old_name;
- reninfo.new = class->get_folder_info(store, new_name, flags, ex);
- if (reninfo.new != NULL) {
- camel_object_trigger_event (store, "folder_renamed", &reninfo);
- class->free_folder_info(store, reninfo.new);
+ folder_info = class->get_folder_info(store, new_name, flags, ex);
+ if (folder_info != NULL) {
+ camel_store_folder_renamed (store, old_name, folder_info);
+ class->free_folder_info (store, folder_info);
}
} else {
/* Failed, just unlock our folders for re-use */
@@ -677,6 +741,114 @@ camel_store_rename_folder (CamelStore *store,
}
/**
+ * camel_store_folder_created:
+ * @store: a #CamelStore
+ * @info: information about the created folder
+ *
+ * Emits the #CamelStore::folder-created signal.
+ *
+ * This function is only intended for Camel providers.
+ *
+ * Since: 3.0
+ **/
+void
+camel_store_folder_created (CamelStore *store,
+ CamelFolderInfo *info)
+{
+ g_return_if_fail (CAMEL_STORE (store));
+ g_return_if_fail (info != NULL);
+
+ g_signal_emit (store, signals[FOLDER_CREATED], 0, info);
+}
+
+/**
+ * camel_store_folder_deleted:
+ * @store: a #CamelStore
+ * @info: information about the deleted folder
+ *
+ * Emits the #CamelStore::folder-deleted signal.
+ *
+ * This function is only intended for Camel providers.
+ *
+ * Since: 3.0
+ **/
+void
+camel_store_folder_deleted (CamelStore *store,
+ CamelFolderInfo *info)
+{
+ g_return_if_fail (CAMEL_STORE (store));
+ g_return_if_fail (info != NULL);
+
+ g_signal_emit (store, signals[FOLDER_DELETED], 0, info);
+}
+
+/**
+ * camel_store_folder_renamed:
+ * @store: a #CamelStore
+ * @old_name: the old name of the folder
+ * @info: information about the renamed folder
+ *
+ * Emits the #CamelStore::folder-renamed signal.
+ *
+ * This function is only intended for Camel providers.
+ *
+ * Since: 3.0
+ **/
+void
+camel_store_folder_renamed (CamelStore *store,
+ const gchar *old_name,
+ CamelFolderInfo *info)
+{
+ g_return_if_fail (CAMEL_STORE (store));
+ g_return_if_fail (old_name != NULL);
+ g_return_if_fail (info != NULL);
+
+ g_signal_emit (store, signals[FOLDER_RENAMED], 0, old_name, info);
+}
+
+/**
+ * camel_store_folder_subscribed:
+ * @store: a #CamelStore
+ * @info: information about the subscribed folder
+ *
+ * Emits the #CamelStore::folder-subscribed signal.
+ *
+ * This function is only intended for Camel providers.
+ *
+ * Since: 3.0
+ **/
+void
+camel_store_folder_subscribed (CamelStore *store,
+ CamelFolderInfo *info)
+{
+ g_return_if_fail (CAMEL_STORE (store));
+ g_return_if_fail (info != NULL);
+
+ g_signal_emit (store, signals[FOLDER_SUBSCRIBED], 0, info);
+}
+
+/**
+ * camel_store_folder_unsubscribed:
+ * @store: a #CamelStore
+ * @info: information about the unsubscribed folder
+ *
+ * Emits the #CamelStore::folder-unsubscribed signal.
+ *
+ * This function is only intended for Camel providers.
+ *
+ * Since: 3.0
+ **/
+void
+camel_store_folder_unsubscribed (CamelStore *store,
+ CamelFolderInfo *info)
+{
+ g_return_if_fail (CAMEL_STORE (store));
+ g_return_if_fail (info != NULL);
+
+ g_signal_emit (store, signals[FOLDER_UNSUBSCRIBED], 0, info);
+}
+
+/**
* camel_store_get_inbox:
* @store: a #CamelStore object
* @ex: a #CamelException
@@ -1211,7 +1383,7 @@ camel_store_supports_subscriptions (CamelStore *store)
}
/**
- * camel_store_folder_subscribed:
+ * camel_store_folder_is_subscribed:
* @store: a #CamelStore object
* @folder_name: full path of the folder
*
@@ -1220,26 +1392,26 @@ camel_store_supports_subscriptions (CamelStore *store)
* Returns: %TRUE if the folder has been subscribed to or %FALSE otherwise
**/
gboolean
-camel_store_folder_subscribed (CamelStore *store,
- const gchar *folder_name)
+camel_store_folder_is_subscribed (CamelStore *store,
+ const gchar *folder_name)
{
CamelStoreClass *class;
- gboolean ret;
+ gboolean is_subscribed;
g_return_val_if_fail (CAMEL_IS_STORE (store), FALSE);
g_return_val_if_fail (folder_name != NULL, FALSE);
g_return_val_if_fail (store->flags & CAMEL_STORE_SUBSCRIPTIONS, FALSE);
class = CAMEL_STORE_GET_CLASS (store);
- g_return_val_if_fail (class->folder_subscribed != NULL, FALSE);
+ g_return_val_if_fail (class->folder_is_subscribed != NULL, FALSE);
camel_store_lock (store, CAMEL_STORE_FOLDER_LOCK);
- ret = class->folder_subscribed (store, folder_name);
+ is_subscribed = class->folder_is_subscribed (store, folder_name);
camel_store_unlock (store, CAMEL_STORE_FOLDER_LOCK);
- return ret;
+ return is_subscribed;
}
/**
diff --git a/camel/camel-store.h b/camel/camel-store.h
index 44602ee..880bccc 100644
--- a/camel/camel-store.h
+++ b/camel/camel-store.h
@@ -126,12 +126,6 @@ typedef struct _CamelFolderInfo {
#define CAMEL_STORE_READ (1 << 0)
#define CAMEL_STORE_WRITE (1 << 1)
-/* Structure of rename event's event_data */
-typedef struct _CamelRenameInfo {
- gchar *old_base;
- struct _CamelFolderInfo *new;
-} CamelRenameInfo;
-
/* Flags for store flags */
#define CAMEL_STORE_SUBSCRIPTIONS (1 << 0)
#define CAMEL_STORE_VTRASH (1 << 1)
@@ -201,6 +195,7 @@ struct _CamelStoreClass {
GHashFunc hash_folder_name;
GCompareFunc compare_folder_name;
+ /* Methods */
CamelFolder * (*get_folder) (CamelStore *store,
const gchar *folder_name,
guint32 flags,
@@ -233,7 +228,7 @@ struct _CamelStoreClass {
CamelException *ex);
void (*free_folder_info) (CamelStore *store,
CamelFolderInfo *fi);
- gboolean (*folder_subscribed) (CamelStore *store,
+ gboolean (*folder_is_subscribed) (CamelStore *store,
const gchar *folder_name);
gboolean (*subscribe_folder) (CamelStore *store,
const gchar *folder_name,
@@ -246,6 +241,21 @@ struct _CamelStoreClass {
gboolean (*can_refresh_folder) (CamelStore *store,
CamelFolderInfo *info,
CamelException *ex);
+
+ /* Signals */
+ void (*folder_created) (CamelStore *store,
+ CamelFolderInfo *info);
+ void (*folder_deleted) (CamelStore *store,
+ CamelFolderInfo *info);
+ void (*folder_opened) (CamelStore *store,
+ CamelFolder *folder);
+ void (*folder_renamed) (CamelStore *store,
+ const gchar *old_name,
+ CamelFolderInfo *info);
+ void (*folder_subscribed) (CamelStore *store,
+ CamelFolderInfo *info);
+ void (*folder_unsubscribed) (CamelStore *store,
+ CamelFolderInfo *info);
};
GType camel_store_get_type (void);
@@ -271,6 +281,17 @@ gboolean camel_store_rename_folder (CamelStore *store,
const gchar *old_namein,
const gchar *new_name,
CamelException *ex);
+void camel_store_folder_created (CamelStore *store,
+ CamelFolderInfo *info);
+void camel_store_folder_deleted (CamelStore *store,
+ CamelFolderInfo *info);
+void camel_store_folder_renamed (CamelStore *store,
+ const gchar *old_name,
+ CamelFolderInfo *info);
+void camel_store_folder_subscribed (CamelStore *store,
+ CamelFolderInfo *info);
+void camel_store_folder_unsubscribed (CamelStore *store,
+ CamelFolderInfo *info);
gboolean camel_store_sync (CamelStore *store,
gint expunge,
CamelException *ex);
@@ -300,7 +321,7 @@ CamelFolderInfo *
camel_folder_info_clone (CamelFolderInfo *fi);
gboolean camel_store_supports_subscriptions
(CamelStore *store);
-gboolean camel_store_folder_subscribed (CamelStore *store,
+gboolean camel_store_folder_is_subscribed(CamelStore *store,
const gchar *folder_name);
gboolean camel_store_subscribe_folder (CamelStore *store,
const gchar *folder_name,
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index d36316f..7c3833c 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -557,7 +557,8 @@ folder_changed_change (CamelSession *session, CamelSessionThreadMsg *msg)
g_free (vuid);
if (unmatched_changes) {
- camel_object_trigger_event ((CamelObject *)folder_unmatched, "folder_changed", unmatched_changes);
+ camel_folder_changed (
+ CAMEL_FOLDER (folder_unmatched), unmatched_changes);
camel_folder_change_info_free (unmatched_changes);
}
@@ -580,7 +581,7 @@ folder_changed_change (CamelSession *session, CamelSessionThreadMsg *msg)
}
if (vf_changes) {
- camel_object_trigger_event ((CamelObject *)vf, "folder_changed", vf_changes);
+ camel_folder_changed (CAMEL_FOLDER (vf), vf_changes);
camel_folder_change_info_free (vf_changes);
}
}
@@ -645,7 +646,7 @@ subfolder_renamed_update (CamelVeeFolder *vf, CamelFolder *sub, gchar hash[8])
camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUMMARY_LOCK);
if (changes) {
- camel_object_trigger_event ((CamelObject *)vf, "folder_changed", changes);
+ camel_folder_changed (CAMEL_FOLDER (vf), changes);
camel_folder_change_info_free (changes);
}
}
@@ -882,9 +883,9 @@ vee_folder_stop_folder (CamelVeeFolder *vf, CamelFolder *sub)
return;
}
- camel_object_unhook_event ((CamelObject *)sub, "folder_changed", (CamelObjectEventHookFunc) folder_changed, vf);
- camel_object_unhook_event ((CamelObject *)sub, "deleted", (CamelObjectEventHookFunc) subfolder_deleted, vf);
- camel_object_unhook_event ((CamelObject *)sub, "renamed", (CamelObjectEventHookFunc) folder_renamed, vf);
+ g_signal_handlers_disconnect_by_func (sub, folder_changed, vf);
+ g_signal_handlers_disconnect_by_func (sub, subfolder_deleted, vf);
+ g_signal_handlers_disconnect_by_func (sub, folder_renamed, vf);
p->folders = g_list_remove (p->folders, sub);
@@ -1589,12 +1590,13 @@ vee_folder_remove_folder_helper (CamelVeeFolder *vf, CamelFolder *source)
camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUMMARY_LOCK);
if (unmatched_changes) {
- camel_object_trigger_event ((CamelObject *)folder_unmatched, "folder_changed", unmatched_changes);
+ camel_folder_changed (
+ CAMEL_FOLDER (folder_unmatched), unmatched_changes);
camel_folder_change_info_free (unmatched_changes);
}
if (vf_changes) {
- camel_object_trigger_event ((CamelObject *)vf, "folder_changed", vf_changes);
+ camel_folder_changed (CAMEL_FOLDER (vf), vf_changes);
camel_folder_change_info_free (vf_changes);
}
}
@@ -1856,12 +1858,14 @@ vee_folder_rebuild_folder (CamelVeeFolder *vee_folder,
camel_folder_free_summary (source, all);
if (unmatched_changes) {
- camel_object_trigger_event ((CamelObject *)folder_unmatched, "folder_changed", unmatched_changes);
+ camel_folder_changed (
+ CAMEL_FOLDER (folder_unmatched), unmatched_changes);
camel_folder_change_info_free (unmatched_changes);
}
if (vee_folder_changes) {
- camel_object_trigger_event ((CamelObject *)vee_folder, "folder_changed", vee_folder_changes);
+ camel_folder_changed (
+ CAMEL_FOLDER (vee_folder), vee_folder_changes);
camel_folder_change_info_free (vee_folder_changes);
}
@@ -2096,9 +2100,17 @@ camel_vee_folder_add_folder (CamelVeeFolder *vf, CamelFolder *sub)
camel_vee_folder_unlock (vf, CAMEL_VEE_FOLDER_SUBFOLDER_LOCK);
- camel_object_hook_event ((CamelObject *)sub, "folder_changed", (CamelObjectEventHookFunc)folder_changed, vf);
- camel_object_hook_event ((CamelObject *)sub, "deleted", (CamelObjectEventHookFunc)subfolder_deleted, vf);
- camel_object_hook_event ((CamelObject *)sub, "renamed", (CamelObjectEventHookFunc)folder_renamed, vf);
+ g_signal_connect (
+ sub, "changed",
+ G_CALLBACK (folder_changed), vf);
+
+ g_signal_connect (
+ sub, "deleted",
+ G_CALLBACK (subfolder_deleted), vf);
+
+ g_signal_connect (
+ sub, "renamed",
+ G_CALLBACK (folder_renamed), vf);
CAMEL_VEE_FOLDER_GET_CLASS (vf)->add_folder (vf, sub);
}
@@ -2128,9 +2140,9 @@ camel_vee_folder_remove_folder (CamelVeeFolder *vf, CamelFolder *sub)
return;
}
- camel_object_unhook_event ((CamelObject *)sub, "folder_changed", (CamelObjectEventHookFunc) folder_changed, vf);
- camel_object_unhook_event ((CamelObject *)sub, "deleted", (CamelObjectEventHookFunc) subfolder_deleted, vf);
- camel_object_unhook_event ((CamelObject *)sub, "renamed", (CamelObjectEventHookFunc) folder_renamed, vf);
+ g_signal_handlers_disconnect_by_func (sub, folder_changed, vf);
+ g_signal_handlers_disconnect_by_func (sub, subfolder_deleted, vf);
+ g_signal_handlers_disconnect_by_func (sub, folder_renamed, vf);
p->folders = g_list_remove (p->folders, sub);
@@ -2333,10 +2345,10 @@ camel_vee_folder_get_location (CamelVeeFolder *vf, const CamelVeeMessageInfo *vi
* Since: 2.26
**/
void
-camel_vee_folder_mask_event_folder_changed (CamelVeeFolder *vf, CamelFolder *sub)
+camel_vee_folder_mask_event_folder_changed (CamelVeeFolder *vf,
+ CamelFolder *sub)
{
- camel_object_unhook_event ((CamelObject *)sub, "folder_changed", (CamelObjectEventHookFunc) folder_changed, vf);
-
+ g_signal_handlers_block_by_func (sub, folder_changed, vf);
}
/**
@@ -2345,9 +2357,10 @@ camel_vee_folder_mask_event_folder_changed (CamelVeeFolder *vf, CamelFolder *sub
* Since: 2.26
**/
void
-camel_vee_folder_unmask_event_folder_changed (CamelVeeFolder *vf, CamelFolder *sub)
+camel_vee_folder_unmask_event_folder_changed (CamelVeeFolder *vf,
+ CamelFolder *sub)
{
- camel_object_hook_event ((CamelObject *)sub, "folder_changed", (CamelObjectEventHookFunc) folder_changed, vf);
+ g_signal_handlers_unblock_by_func (sub, folder_changed, vf);
}
/**
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c
index 71ae5bd..9ddc6b5 100644
--- a/camel/camel-vee-store.c
+++ b/camel/camel-vee-store.c
@@ -88,7 +88,10 @@ change_folder (CamelStore *store,
fi->flags = CAMEL_FOLDER_VIRTUAL;
if (!(flags & CHANGE_DELETE))
fi->flags |= CAMEL_FOLDER_NOCHILDREN;
- camel_object_trigger_event (store, (flags&CHANGE_DELETE)?"folder_deleted":"folder_created", fi);
+ if (flags & CHANGE_DELETE)
+ camel_store_folder_deleted (store, fi);
+ else
+ camel_store_folder_created (store, fi);
camel_folder_info_free (fi);
}
diff --git a/camel/camel-vee-summary.c b/camel/camel-vee-summary.c
index 004749c..79fa82c 100644
--- a/camel/camel-vee-summary.c
+++ b/camel/camel-vee-summary.c
@@ -317,7 +317,7 @@ vee_info_set_flags(CamelMessageInfo *mi, guint32 flags, guint32 set)
if (match)
camel_folder_search_free(rmi->summary->folder, match);
- camel_object_trigger_event(mi->summary->folder, "folder_changed", changes);
+ camel_folder_changed (mi->summary->folder, changes);
camel_folder_change_info_free(changes);
}
camel_message_info_free (rmi);
diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c
index d3c847b..324d7d0 100644
--- a/camel/providers/groupwise/camel-groupwise-folder.c
+++ b/camel/providers/groupwise/camel-groupwise-folder.c
@@ -1007,7 +1007,7 @@ groupwise_sync (CamelFolder *folder, gboolean expunge, CamelMessageInfo *update_
success = groupwise_sync_summary (folder, ex);
camel_service_unlock (CAMEL_SERVICE (gw_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
+ camel_folder_changed (folder, changes);
camel_folder_change_info_free (changes);
return success;
@@ -1867,8 +1867,8 @@ gw_update_cache (CamelFolder *folder, GList *list, CamelException *ex, gboolean
g_free (container_id);
g_string_free (str, TRUE);
groupwise_sync_summary (folder, ex);
- camel_object_trigger_event (folder, "folder_changed", changes);
+ camel_folder_changed (folder, changes);
camel_folder_change_info_free (changes);
}
@@ -2073,8 +2073,8 @@ gw_update_summary (CamelFolder *folder, GList *list,CamelException *ex)
}
g_free (container_id);
g_string_free (str, TRUE);
- camel_object_trigger_event (folder, "folder_changed", changes);
+ camel_folder_changed (folder, changes);
camel_folder_change_info_free (changes);
}
@@ -2451,7 +2451,7 @@ gw_update_all_items (CamelFolder *folder, GList *item_list, CamelException *ex)
}
groupwise_sync_summary (folder, ex);
- camel_object_trigger_event (folder, "folder_changed", changes);
+ camel_folder_changed (folder, changes);
if (item_list) {
CamelStore *parent_store;
@@ -2779,7 +2779,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
index ++;
}
- camel_object_trigger_event (source, "folder_changed", changes);
+ camel_folder_changed (source, changes);
camel_folder_change_info_free (changes);
/* Refresh the destination folder, if its not refreshed already */
@@ -2902,7 +2902,7 @@ groupwise_expunge (CamelFolder *folder, CamelException *ex)
}
if (delete)
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
+ camel_folder_changed (folder, changes);
g_free (container_id);
camel_folder_change_info_free (changes);
diff --git a/camel/providers/groupwise/camel-groupwise-store.c b/camel/providers/groupwise/camel-groupwise-store.c
index d061233..c15776b 100644
--- a/camel/providers/groupwise/camel-groupwise-store.c
+++ b/camel/providers/groupwise/camel-groupwise-store.c
@@ -520,7 +520,7 @@ groupwise_forget_folder (CamelGroupwiseStore *gw_store, const gchar *folder_name
camel_store_summary_save ( (CamelStoreSummary *)gw_store->summary);
fi = groupwise_build_folder_info(gw_store, NULL, folder_name);
- camel_object_trigger_event (CAMEL_OBJECT (gw_store), "folder_deleted", fi);
+ camel_store_folder_deleted (CAMEL_STORE (gw_store), fi);
camel_folder_info_free (fi);
}
@@ -1201,7 +1201,7 @@ create_junk_folder (CamelStore *store)
g_hash_table_insert (priv->id_hash, g_strdup(child_container_id), g_strdup(folder_name));
g_hash_table_insert (priv->name_hash, g_strdup(folder_name), g_strdup(child_container_id));
g_hash_table_insert (priv->parent_hash, g_strdup(child_container_id), g_strdup(parent_id));
- camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", root);
+ camel_store_folder_created (store, root);
}
camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK);
@@ -1266,7 +1266,7 @@ groupwise_create_folder(CamelStore *store,
g_hash_table_insert (priv->name_hash, g_strdup(root->full_name), g_strdup(child_container_id));
g_hash_table_insert (priv->parent_hash, g_strdup(child_container_id), g_strdup(parent_id));
- camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", root);
+ camel_store_folder_created (store, root);
}
camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK);
return root;
diff --git a/camel/providers/groupwise/camel-groupwise-summary.c b/camel/providers/groupwise/camel-groupwise-summary.c
index f8f1cb1..874fb91 100644
--- a/camel/providers/groupwise/camel-groupwise-summary.c
+++ b/camel/providers/groupwise/camel-groupwise-summary.c
@@ -378,7 +378,7 @@ gw_info_set_flags (CamelMessageInfo *info, guint32 flags, guint32 set)
CamelFolderChangeInfo *changes = camel_folder_change_info_new();
camel_folder_change_info_change_uid(changes, camel_message_info_uid(info));
- camel_object_trigger_event(mi->summary->folder, "folder_changed", changes);
+ camel_folder_changed (mi->summary->folder, changes);
camel_folder_change_info_free(changes);
camel_folder_summary_touch(mi->summary);
}
@@ -451,7 +451,7 @@ groupwise_summary_clear (CamelFolderSummary *summary, gboolean uncache)
/*camel_folder_summary_save (summary);*/
if (camel_folder_change_info_changed (changes))
- camel_object_trigger_event (summary->folder, "folder_changed", changes);
+ camel_folder_changed (summary->folder, changes);
camel_folder_change_info_free (changes);
}
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 52115fb..57c3e36 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -1147,7 +1147,7 @@ imap_rescan (CamelFolder *folder, gint exists, CamelException *ex)
}
if (changes) {
- camel_object_trigger_event(CAMEL_OBJECT (folder), "folder_changed", changes);
+ camel_folder_changed (folder, changes);
camel_folder_change_info_free(changes);
}
@@ -1631,7 +1631,7 @@ imap_expunge_uids_offline (CamelFolder *folder,
camel_imap_journal_log (CAMEL_IMAP_FOLDER (folder)->journal,
CAMEL_IMAP_JOURNAL_ENTRY_EXPUNGE, uids);
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
+ camel_folder_changed (folder, changes);
camel_folder_change_info_free (changes);
return TRUE;
@@ -1724,7 +1724,7 @@ imap_expunge_uids_online (CamelFolder *folder,
camel_db_delete_uids (parent_store->cdb_w, full_name, list, ex);
g_slist_free (list);
camel_folder_summary_save_to_db (folder->summary, ex);
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
+ camel_folder_changed (folder, changes);
camel_folder_change_info_free (changes);
return TRUE;
@@ -1967,8 +1967,7 @@ imap_append_offline (CamelFolder *folder,
changes = camel_folder_change_info_new ();
camel_folder_change_info_add_uid (changes, uid);
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed",
- changes);
+ camel_folder_changed (folder, changes);
camel_folder_change_info_free (changes);
camel_imap_journal_log (CAMEL_IMAP_FOLDER (folder)->journal,
@@ -2290,7 +2289,7 @@ imap_transfer_offline (CamelFolder *source,
CAMEL_IMAP_FOLDER_REC_UNLOCK (dest, cache_lock);
CAMEL_IMAP_FOLDER_REC_UNLOCK (source, cache_lock);
- camel_object_trigger_event (CAMEL_OBJECT (dest), "folder_changed", changes);
+ camel_folder_changed (dest, changes);
camel_folder_change_info_free (changes);
camel_imap_journal_log (
@@ -3965,7 +3964,7 @@ camel_imap_folder_changed (CamelFolder *folder, gint exists,
camel_folder_summary_save_to_db (folder->summary, ex);
if (camel_folder_change_info_changed (changes))
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
+ camel_folder_changed (folder, changes);
camel_folder_change_info_free (changes);
diff --git a/camel/providers/imap/camel-imap-message-cache.c b/camel/providers/imap/camel-imap-message-cache.c
index e0e0c94..517fad6 100644
--- a/camel/providers/imap/camel-imap-message-cache.c
+++ b/camel/providers/imap/camel-imap-message-cache.c
@@ -47,8 +47,6 @@
#define BASE_PART_SUFFIX "."
#endif
-static void stream_finalize (CamelObject *stream, gpointer event_data, gpointer user_data);
-
struct _part_find {
/* UID name on disk - e.g. "0." or "0.HEADERS". On windows "0." is
* stored as "0.~"
@@ -61,12 +59,26 @@ struct _part_find {
G_DEFINE_TYPE (CamelImapMessageCache, camel_imap_message_cache, CAMEL_TYPE_OBJECT)
static void
+stream_finalize (CamelImapMessageCache *cache,
+ GObject *where_the_object_was)
+{
+ gchar *key;
+
+ key = g_hash_table_lookup (cache->cached, where_the_object_was);
+ if (!key)
+ return;
+ g_hash_table_remove (cache->cached, where_the_object_was);
+ g_hash_table_insert (cache->parts, key, NULL);
+}
+
+static void
free_part (gpointer key, gpointer value, gpointer data)
{
if (value) {
if (strchr (key, '.')) {
- camel_object_unhook_event (value, "finalize",
- stream_finalize, data);
+ g_object_weak_unref (
+ G_OBJECT (value), (GWeakNotify)
+ stream_finalize, data);
g_object_unref (value);
} else
g_ptr_array_free (value, TRUE);
@@ -130,8 +142,9 @@ cache_put (CamelImapMessageCache *cache, const gchar *uid, const gchar *key,
if (g_hash_table_lookup_extended (cache->parts, key, &okey, &ostream)) {
if (ostream) {
- camel_object_unhook_event (ostream, "finalize",
- stream_finalize, cache);
+ g_object_weak_unref (
+ G_OBJECT (ostream), (GWeakNotify)
+ stream_finalize, cache);
g_hash_table_remove (cache->cached, ostream);
g_object_unref (ostream);
}
@@ -145,8 +158,9 @@ cache_put (CamelImapMessageCache *cache, const gchar *uid, const gchar *key,
g_hash_table_insert (cache->cached, stream, hash_key);
if (stream) {
- camel_object_hook_event (CAMEL_OBJECT (stream), "finalize",
- stream_finalize, cache);
+ g_object_weak_ref (
+ G_OBJECT (stream), (GWeakNotify)
+ stream_finalize, cache);
}
}
@@ -292,19 +306,6 @@ camel_imap_message_cache_set_path (CamelImapMessageCache *cache, const gchar *pa
cache->path = g_strdup(path);
}
-static void
-stream_finalize (CamelObject *stream, gpointer event_data, gpointer user_data)
-{
- CamelImapMessageCache *cache = user_data;
- gchar *key;
-
- key = g_hash_table_lookup (cache->cached, stream);
- if (!key)
- return;
- g_hash_table_remove (cache->cached, stream);
- g_hash_table_insert (cache->parts, key, NULL);
-}
-
static CamelStream *
insert_setup (CamelImapMessageCache *cache, const gchar *uid, const gchar *part_spec,
gchar **path, gchar **key, CamelException *ex)
@@ -578,8 +579,9 @@ camel_imap_message_cache_remove (CamelImapMessageCache *cache, const gchar *uid)
g_free (path);
stream = g_hash_table_lookup (cache->parts, key);
if (stream) {
- camel_object_unhook_event (stream, "finalize",
- stream_finalize, cache);
+ g_object_weak_unref (
+ G_OBJECT (stream), (GWeakNotify)
+ stream_finalize, cache);
g_object_unref (stream);
g_hash_table_remove (cache->cached, stream);
}
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index b1beee2..61ec57c 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -82,7 +82,7 @@ static gint compare_folder_name (gconstpointer a, gconstpointer b);
static CamelFolderInfo *create_folder (CamelStore *store, const gchar *parent_name, const gchar *folder_name, CamelException *ex);
static gboolean delete_folder (CamelStore *store, const gchar *folder_name, CamelException *ex);
static gboolean rename_folder (CamelStore *store, const gchar *old_name, const gchar *new_name, CamelException *ex);
-static gboolean folder_subscribed (CamelStore *store, const gchar *folder_name);
+static gboolean folder_is_subscribed (CamelStore *store, const gchar *folder_name);
static gboolean subscribe_folder (CamelStore *store, const gchar *folder_name,
CamelException *ex);
static gboolean unsubscribe_folder (CamelStore *store, const gchar *folder_name,
@@ -172,7 +172,7 @@ camel_imap_store_class_init (CamelImapStoreClass *class)
store_class->rename_folder = rename_folder;
store_class->get_folder_info = get_folder_info;
store_class->free_folder_info = camel_store_free_folder_info_full;
- store_class->folder_subscribed = folder_subscribed;
+ store_class->folder_is_subscribed = folder_is_subscribed;
store_class->subscribe_folder = subscribe_folder;
store_class->unsubscribe_folder = unsubscribe_folder;
store_class->noop = imap_noop;
@@ -950,7 +950,7 @@ imap_folder_effectively_unsubscribed (CamelImapStore *imap_store,
}
fi = imap_build_folder_info(imap_store, folder_name);
- camel_object_trigger_event (CAMEL_OBJECT (imap_store), "folder_unsubscribed", fi);
+ camel_store_folder_unsubscribed (CAMEL_STORE (imap_store), fi);
camel_folder_info_free (fi);
return TRUE;
@@ -1004,7 +1004,7 @@ imap_forget_folder (CamelImapStore *imap_store, const gchar *folder_name, CamelE
camel_store_summary_save((CamelStoreSummary *)imap_store->summary);
fi = imap_build_folder_info(imap_store, folder_name);
- camel_object_trigger_event (CAMEL_OBJECT (imap_store), "folder_deleted", fi);
+ camel_store_folder_deleted (CAMEL_STORE (imap_store), fi);
camel_folder_info_free (fi);
}
@@ -2295,10 +2295,10 @@ create_folder (CamelStore *store, const gchar *parent_name,
} else {
root = fi;
}
- camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", root);
+ camel_store_folder_created (store, root);
} else if (root) {
/* need to re-recreate the folder we just deleted */
- camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", root);
+ camel_store_folder_created (store, root);
camel_folder_info_free(root);
root = NULL;
}
@@ -2534,8 +2534,8 @@ get_folders_sync (CamelImapStore *imap_store, const gchar *ppattern, CamelExcept
si->flags = (si->flags & ~CAMEL_FOLDER_SUBSCRIBED) | (fi->flags & CAMEL_FOLDER_SUBSCRIBED);
camel_store_summary_touch((CamelStoreSummary *)imap_store->summary);
- camel_object_trigger_event (CAMEL_OBJECT (imap_store), "folder_created", fi);
- camel_object_trigger_event (CAMEL_OBJECT (imap_store), "folder_subscribed", fi);
+ camel_store_folder_created (CAMEL_STORE (imap_store), fi);
+ camel_store_folder_subscribed (CAMEL_STORE (imap_store), fi);
}
} else {
gchar *dup_folder_name = g_strdup (camel_store_info_path (imap_store->summary, si));
@@ -2860,7 +2860,8 @@ get_folder_info_offline (CamelStore *store, const gchar *top,
}
static gboolean
-folder_subscribed (CamelStore *store, const gchar *folder_name)
+folder_is_subscribed (CamelStore *store,
+ const gchar *folder_name)
{
CamelImapStore *imap_store = CAMEL_IMAP_STORE (store);
CamelStoreInfo *si;
@@ -2923,7 +2924,7 @@ subscribe_folder (CamelStore *store,
fi = imap_build_folder_info(imap_store, folder_name);
fi->flags |= CAMEL_FOLDER_NOCHILDREN;
- camel_object_trigger_event (CAMEL_OBJECT (store), "folder_subscribed", fi);
+ camel_store_folder_subscribed (store, fi);
camel_folder_info_free (fi);
done:
camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK);
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 86c291e..7b9e0bf 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -1131,7 +1131,7 @@ imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
full_name = camel_folder_get_full_name (imap->select_folder);
camel_db_delete_uids (imap->store->cdb_w, full_name, imap->expunged, NULL);
imapx_update_store_summary (imap->select_folder);
- camel_object_trigger_event(imap->select_folder, "folder_changed", imap->changes);
+ camel_folder_changed (imap->select_folder, imap->changes);
g_slist_foreach (imap->expunged, (GFunc) g_free, NULL);
imap->expunged = NULL;
@@ -1239,7 +1239,7 @@ imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
if (imapx_idle_supported (imap) && changed && imapx_in_idle (imap)) {
camel_folder_summary_save_to_db (imap->select_folder->summary, NULL);
imapx_update_store_summary (imap->select_folder);
- camel_object_trigger_event(imap->select_folder, "folder_changed", imap->changes);
+ camel_folder_changed (imap->select_folder, imap->changes);
camel_folder_change_info_clear (imap->changes);
}
@@ -1401,7 +1401,6 @@ imapx_untagged(CamelIMAPXServer *imap, CamelException *ex)
/* TODO: handle bye/preauth differently */
camel_imapx_stream_ungettoken(imap->stream, tok, token, len);
sinfo = imapx_parse_status(imap->stream, ex);
- camel_object_trigger_event(imap, "status", sinfo);
switch (sinfo->condition) {
case IMAPX_READ_WRITE:
imap->mode = IMAPX_MODE_READ|IMAPX_MODE_WRITE;
@@ -1593,7 +1592,7 @@ imapx_completion(CamelIMAPXServer *imap, guchar *token, gint len, CamelException
}
imapx_update_store_summary (imap->select_folder);
- camel_object_trigger_event(imap->select_folder, "folder_changed", imap->changes);
+ camel_folder_changed (imap->select_folder, imap->changes);
camel_folder_change_info_clear (imap->changes);
}
@@ -2678,8 +2677,7 @@ imapx_command_append_message_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
changes = camel_folder_change_info_new ();
camel_folder_change_info_add_uid (changes, mi->uid);
- camel_object_trigger_event (CAMEL_OBJECT (job->folder), "folder_changed",
- changes);
+ camel_folder_changed (job->folder, changes);
camel_folder_change_info_free (changes);
g_free(cur);
@@ -2806,7 +2804,7 @@ imapx_command_step_fetch_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic)
if (camel_folder_change_info_changed(job->u.refresh_info.changes)) {
imapx_update_store_summary (job->folder);
camel_folder_summary_save_to_db (job->folder->summary, NULL);
- camel_object_trigger_event(job->folder, "folder_changed", job->u.refresh_info.changes);
+ camel_folder_changed (job->folder, job->u.refresh_info.changes);
}
camel_folder_change_info_clear(job->u.refresh_info.changes);
@@ -2999,7 +2997,7 @@ imapx_job_scan_changes_done(CamelIMAPXServer *is, CamelIMAPXCommand *ic)
imapx_update_store_summary (job->folder);
if (camel_folder_change_info_changed(job->u.refresh_info.changes))
- camel_object_trigger_event(job->folder, "folder_changed", job->u.refresh_info.changes);
+ camel_folder_changed (job->folder, job->u.refresh_info.changes);
camel_folder_change_info_clear(job->u.refresh_info.changes);
camel_folder_free_uids (job->folder, uids);
@@ -3067,7 +3065,7 @@ imapx_command_fetch_new_messages_done (CamelIMAPXServer *is, CamelIMAPXCommand *
if (camel_folder_change_info_changed(ic->job->u.refresh_info.changes)) {
imapx_update_store_summary (ic->job->folder);
camel_folder_summary_save_to_db (ic->job->folder->summary, NULL);
- camel_object_trigger_event(ic->job->folder, "folder_changed", ic->job->u.refresh_info.changes);
+ camel_folder_changed (ic->job->folder, ic->job->u.refresh_info.changes);
camel_folder_change_info_clear(ic->job->u.refresh_info.changes);
}
@@ -3238,7 +3236,7 @@ imapx_command_expunge_done (CamelIMAPXServer *is, CamelIMAPXCommand *ic)
camel_db_delete_uids (parent_store->cdb_w, full_name, removed, ic->job->ex);
camel_folder_summary_save_to_db (folder->summary, ic->job->ex);
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes);
+ camel_folder_changed (folder, changes);
camel_folder_change_info_free (changes);
g_slist_free (removed);
@@ -3882,8 +3880,6 @@ camel_imapx_server_class_init(CamelIMAPXServerClass *class)
object_class->constructed = imapx_server_constructed;
class->tagprefix = 'A';
-
-// camel_object_class_add_event((CamelObjectClass *)class, "status", NULL);
}
static void
@@ -4267,7 +4263,7 @@ camel_imapx_server_refresh_info (CamelIMAPXServer *is, CamelFolder *folder, Came
imapx_run_job (is, job);
if (camel_folder_change_info_changed(job->u.refresh_info.changes))
- camel_object_trigger_event(folder, "folder_changed", job->u.refresh_info.changes);
+ camel_folder_changed (folder, job->u.refresh_info.changes);
}
camel_folder_change_info_free(job->u.refresh_info.changes);
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index cc451ab..3af319a 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -518,7 +518,7 @@ imapx_unmark_folder_subscribed (CamelIMAPXStore *istore, const gchar *folder_nam
CamelFolderInfo *fi;
fi = imapx_build_folder_info(istore, folder_name);
- camel_object_trigger_event (CAMEL_OBJECT (istore), "folder_unsubscribed", fi);
+ camel_store_folder_unsubscribed (CAMEL_STORE (istore), fi);
camel_folder_info_free (fi);
}
}
@@ -542,7 +542,7 @@ imapx_mark_folder_subscribed (CamelIMAPXStore *istore, const gchar *folder_name,
CamelFolderInfo *fi;
fi = imapx_build_folder_info(istore, folder_name);
- camel_object_trigger_event (CAMEL_OBJECT (istore), "folder_subscribed", fi);
+ camel_store_folder_subscribed (CAMEL_STORE (istore), fi);
camel_folder_info_free (fi);
}
}
@@ -637,7 +637,7 @@ imapx_delete_folder_from_cache (CamelIMAPXStore *istore, const gchar *folder_nam
camel_store_summary_save((CamelStoreSummary *)istore->summary);
fi = imapx_build_folder_info(istore, folder_name);
- camel_object_trigger_event (CAMEL_OBJECT (istore), "folder_deleted", fi);
+ camel_store_folder_deleted (CAMEL_STORE (istore), fi);
camel_folder_info_free (fi);
}
@@ -818,7 +818,7 @@ imapx_create_folder (CamelStore *store, const gchar *parent_name, const gchar *f
camel_store_summary_save((CamelStoreSummary *)istore->summary);
fi = imapx_build_folder_info(istore, camel_store_info_path(istore->summary, si));
fi->flags |= CAMEL_FOLDER_NOCHILDREN;
- camel_object_trigger_event (CAMEL_OBJECT (store), "folder_created", fi);
+ camel_store_folder_created (store, fi);
}
g_free (full_name);
@@ -1141,8 +1141,8 @@ sync_folders (CamelIMAPXStore *istore, const gchar *pattern, gboolean sync, Came
si->flags = (si->flags & ~CAMEL_FOLDER_SUBSCRIBED) | (fi->flags & CAMEL_FOLDER_SUBSCRIBED);
camel_store_summary_touch((CamelStoreSummary *)istore->summary);
- camel_object_trigger_event (CAMEL_OBJECT (istore), "folder_created", fi);
- camel_object_trigger_event (CAMEL_OBJECT (istore), "folder_subscribed", fi);
+ camel_store_folder_created (CAMEL_STORE (istore), fi);
+ camel_store_folder_subscribed (CAMEL_STORE (istore), fi);
}
} else {
gchar *dup_folder_name = g_strdup (camel_store_info_path (istore->summary, si));
@@ -1345,7 +1345,8 @@ imapx_can_refresh_folder (CamelStore *store, CamelFolderInfo *info, CamelExcepti
}
static gboolean
-imapx_folder_subscribed (CamelStore *store, const gchar *folder_name)
+imapx_folder_is_subscribed (CamelStore *store,
+ const gchar *folder_name)
{
CamelIMAPXStore *istore = CAMEL_IMAPX_STORE (store);
CamelStoreInfo *si;
@@ -1392,7 +1393,7 @@ camel_imapx_store_class_init(CamelIMAPXStoreClass *class)
store_class->subscribe_folder = imapx_store_subscribe_folder;
store_class->unsubscribe_folder = imapx_store_unsubscribe_folder;
store_class->get_folder_info = imapx_get_folder_info;
- store_class->folder_subscribed = imapx_folder_subscribed;
+ store_class->folder_is_subscribed = imapx_folder_is_subscribed;
store_class->free_folder_info = camel_store_free_folder_info_full;
store_class->hash_folder_name = imapx_name_hash;
store_class->compare_folder_name = imapx_name_equal;
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 0884c19..d1b4a8c 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -421,7 +421,7 @@ camel_local_folder_construct(CamelLocalFolder *lf, guint32 flags, CamelException
camel_url_free (url);
- camel_object_trigger_event(CAMEL_OBJECT (parent_store), "folder_created", fi);
+ camel_store_folder_created (parent_store, fi);
camel_folder_info_free(fi);
}
@@ -502,7 +502,7 @@ local_refresh_info(CamelFolder *folder, CamelException *ex)
}
if (camel_folder_change_info_changed(lf->changes)) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", lf->changes);
+ camel_folder_changed (folder, lf->changes);
camel_folder_change_info_clear(lf->changes);
}
@@ -534,7 +534,7 @@ local_sync(CamelFolder *folder, gboolean expunge, CamelException *ex)
camel_local_folder_unlock(lf);
if (camel_folder_change_info_changed(lf->changes)) {
- camel_object_trigger_event(CAMEL_OBJECT(folder), "folder_changed", lf->changes);
+ camel_folder_changed (folder, lf->changes);
camel_folder_change_info_clear(lf->changes);
}
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
index 83476ee..29a4149 100644
--- a/camel/providers/local/camel-local-store.c
+++ b/camel/providers/local/camel-local-store.c
@@ -306,10 +306,6 @@ create_folder (CamelStore *store,
g_object_unref (folder);
info = CAMEL_STORE_GET_CLASS (store)->get_folder_info (
store, name, 0, ex);
-
- /* get_folder(CREATE) will emit a folder_created event for us */
- /*if (info)
- camel_object_trigger_event((CamelObject *)store, "folder_created", info);*/
}
g_free(name);
@@ -500,8 +496,7 @@ delete_folder (CamelStore *store,
CAMEL_LOCAL_STORE(store)->toplevel_dir, folder_name);
fi->unread = -1;
- camel_object_trigger_event (store, "folder_deleted", fi);
-
+ camel_store_folder_deleted (store, fi);
camel_folder_info_free (fi);
return TRUE;
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
index dcab594..a85432c 100644
--- a/camel/providers/local/camel-maildir-folder.c
+++ b/camel/providers/local/camel-maildir-folder.c
@@ -209,7 +209,7 @@ maildir_append_message (CamelFolder *folder,
camel_local_folder_unlock (lf);
if (lf && camel_folder_change_info_changed (lf->changes)) {
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", lf->changes);
+ camel_folder_changed (folder, lf->changes);
camel_folder_change_info_clear (lf->changes);
}
@@ -300,7 +300,7 @@ maildir_get_message (CamelFolder *folder,
camel_local_folder_unlock (lf);
if (lf && camel_folder_change_info_changed (lf->changes)) {
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", lf->changes);
+ camel_folder_changed (folder, lf->changes);
camel_folder_change_info_clear (lf->changes);
}
diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c
index 2cf2656..640262e 100644
--- a/camel/providers/local/camel-mbox-folder.c
+++ b/camel/providers/local/camel-mbox-folder.c
@@ -245,7 +245,7 @@ mbox_append_message (CamelFolder *folder,
camel_local_folder_unlock(lf);
if (camel_folder_change_info_changed(lf->changes)) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", lf->changes);
+ camel_folder_changed (folder, lf->changes);
camel_folder_change_info_clear(lf->changes);
}
@@ -298,7 +298,7 @@ fail:
/* cascade the changes through, anyway, if there are any outstanding */
if (camel_folder_change_info_changed(lf->changes)) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", lf->changes);
+ camel_folder_changed (folder, lf->changes);
camel_folder_change_info_clear(lf->changes);
}
@@ -462,7 +462,7 @@ fail:
/* use the opportunity to notify of changes (particularly if we had a rebuild) */
if (camel_folder_change_info_changed(lf->changes)) {
- camel_object_trigger_event((CamelObject *)folder, "folder_changed", lf->changes);
+ camel_folder_changed (folder, lf->changes);
camel_folder_change_info_clear(lf->changes);
}
diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c
index be2e915..dc22492 100644
--- a/camel/providers/local/camel-mbox-store.c
+++ b/camel/providers/local/camel-mbox-store.c
@@ -338,8 +338,7 @@ delete_folder(CamelStore *store, const gchar *folder_name, CamelException *ex)
fi->uri = g_strdup_printf("mbox:%s#%s",((CamelService *) store)->url->path, folder_name);
fi->unread = -1;
- camel_object_trigger_event(store, "folder_deleted", fi);
-
+ camel_store_folder_deleted (store, fi);
camel_folder_info_free(fi);
return TRUE;
diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c
index 4fdafee..23bc663 100644
--- a/camel/providers/local/camel-mh-folder.c
+++ b/camel/providers/local/camel-mh-folder.c
@@ -181,7 +181,7 @@ mh_append_message (CamelFolder *folder,
camel_local_folder_unlock (lf);
if (lf && camel_folder_change_info_changed (lf->changes)) {
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", lf->changes);
+ camel_folder_changed (folder, lf->changes);
camel_folder_change_info_clear (lf->changes);
}
@@ -251,7 +251,7 @@ mh_get_message (CamelFolder *folder,
camel_local_folder_unlock (lf);
if (lf && camel_folder_change_info_changed (lf->changes)) {
- camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", lf->changes);
+ camel_folder_changed (folder, lf->changes);
camel_folder_change_info_clear (lf->changes);
}
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index f1ff319..ae394dc 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -115,7 +115,7 @@ nntp_folder_refresh_info_online (CamelFolder *folder,
camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
if (changes) {
- camel_object_trigger_event ((CamelObject *) folder, "folder_changed", changes);
+ camel_folder_changed (folder, changes);
camel_folder_change_info_free (changes);
}
@@ -364,7 +364,7 @@ fail:
camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
if (changes) {
- camel_object_trigger_event ((CamelObject *) folder, "folder_changed", changes);
+ camel_folder_changed (folder, changes);
camel_folder_change_info_free (changes);
}
diff --git a/camel/providers/nntp/camel-nntp-store.c b/camel/providers/nntp/camel-nntp-store.c
index 433a708..d42f91f 100644
--- a/camel/providers/nntp/camel-nntp-store.c
+++ b/camel/providers/nntp/camel-nntp-store.c
@@ -675,7 +675,7 @@ nntp_store_get_subscribed_folder_info (CamelNNTPStore *store, const gchar *top,
}
camel_service_unlock (CAMEL_SERVICE (store), CAMEL_SERVICE_REC_CONNECT_LOCK);
if (changes) {
- camel_object_trigger_event((CamelObject *) folder, "folder_changed", changes);
+ camel_folder_changed (CAMEL_FOLDER (folder), changes);
camel_folder_change_info_free(changes);
}
g_object_unref (folder);
@@ -1026,7 +1026,7 @@ nntp_get_folder_info_offline(CamelStore *store, const gchar *top, guint32 flags,
}
static gboolean
-nntp_store_folder_subscribed (CamelStore *store, const gchar *folder_name)
+nntp_store_folder_is_subscribed (CamelStore *store, const gchar *folder_name)
{
CamelNNTPStore *nntp_store = CAMEL_NNTP_STORE (store);
CamelStoreInfo *si;
@@ -1068,7 +1068,7 @@ nntp_store_subscribe_folder (CamelStore *store, const gchar *folder_name,
camel_store_summary_touch ((CamelStoreSummary *) nntp_store->summary);
camel_store_summary_save ((CamelStoreSummary *) nntp_store->summary);
camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
- camel_object_trigger_event ((CamelObject *) nntp_store, "folder_subscribed", fi);
+ camel_store_folder_subscribed (CAMEL_STORE (nntp_store), fi);
camel_folder_info_free (fi);
return TRUE;
}
@@ -1105,7 +1105,7 @@ nntp_store_unsubscribe_folder (CamelStore *store, const gchar *folder_name,
camel_store_summary_touch ((CamelStoreSummary *) nntp_store->summary);
camel_store_summary_save ((CamelStoreSummary *) nntp_store->summary);
camel_service_unlock (CAMEL_SERVICE (nntp_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
- camel_object_trigger_event ((CamelObject *) nntp_store, "folder_unsubscribed", fi);
+ camel_store_folder_unsubscribed (CAMEL_STORE (nntp_store), fi);
camel_folder_info_free (fi);
return TRUE;
}
@@ -1239,7 +1239,7 @@ camel_nntp_store_class_init (CamelNNTPStoreClass *class)
store_class = CAMEL_STORE_CLASS (class);
store_class->free_folder_info = camel_store_free_folder_info_full;
- store_class->folder_subscribed = nntp_store_folder_subscribed;
+ store_class->folder_is_subscribed = nntp_store_folder_is_subscribed;
store_class->subscribe_folder = nntp_store_subscribe_folder;
store_class->unsubscribe_folder = nntp_store_unsubscribe_folder;
store_class->create_folder = nntp_create_folder;
diff --git a/configure.ac b/configure.ac
index d02095b..bc272e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -84,7 +84,7 @@ LIBEGROUPWISE_CURRENT=13
LIBEGROUPWISE_REVISION=1
LIBEGROUPWISE_AGE=0
-LIBCAMEL_CURRENT=15
+LIBCAMEL_CURRENT=16
LIBCAMEL_REVISION=0
LIBCAMEL_AGE=0
diff --git a/docs/reference/camel/Makefile.am b/docs/reference/camel/Makefile.am
index 2e37ee0..5ba4836 100644
--- a/docs/reference/camel/Makefile.am
+++ b/docs/reference/camel/Makefile.am
@@ -49,6 +49,7 @@ IGNORE_HFILES = \
camel-imap-private.h \
camel-imap-types.h \
camel-local-private.h \
+ camel-marshal.h \
camel-net-utils-win32.h \
camel-nntp-private.h \
camel-nntp-types.h \
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index 88b3d2f..8283873 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -458,6 +458,7 @@ camel_folder_ref_message_info
camel_folder_transfer_messages_to
camel_folder_delete
camel_folder_rename
+camel_folder_changed
camel_folder_freeze
camel_folder_thaw
camel_folder_is_frozen
@@ -1445,15 +1446,7 @@ camel_nntp_address_get_type
<FILE>camel-object</FILE>
<TITLE>CamelObject</TITLE>
CamelObject
-CamelObjectHookID
-CamelObjectEventPrepFunc
-CamelObjectEventHookFunc
CamelParamFlags
-camel_object_class_add_event
-camel_object_hook_event
-camel_object_remove_event
-camel_object_unhook_event
-camel_object_trigger_event
camel_object_state_read
camel_object_state_write
camel_object_get_state_filename
@@ -1927,17 +1920,17 @@ camel_session_get_password
camel_session_forget_password
camel_session_alert_user
camel_session_build_password_prompt
-camel_session_is_online
+camel_session_get_online
camel_session_set_online
camel_session_get_filter_driver
-camel_session_check_junk
+camel_session_get_check_junk
camel_session_set_check_junk
camel_session_thread_msg_new
camel_session_thread_msg_free
camel_session_thread_queue
camel_session_thread_wait
-camel_session_get_network_state
-camel_session_set_network_state
+camel_session_get_network_available
+camel_session_set_network_available
camel_session_get_junk_headers
camel_session_set_junk_headers
camel_session_lookup_addressbook
@@ -2057,7 +2050,6 @@ CAMEL_FOLDER_TYPE_JUNK
CAMEL_FOLDER_TYPE_SENT
CAMEL_STORE_READ
CAMEL_STORE_WRITE
-CamelRenameInfo
CAMEL_STORE_SUBSCRIPTIONS
CAMEL_STORE_VTRASH
CAMEL_STORE_FILTER_INBOX
@@ -2082,6 +2074,11 @@ camel_store_get_junk
camel_store_create_folder
camel_store_delete_folder
camel_store_rename_folder
+camel_store_folder_created
+camel_store_folder_deleted
+camel_store_folder_renamed
+camel_store_folder_subscribed
+camel_store_folder_unsubscribed
camel_store_sync
camel_store_get_folder_info
camel_store_free_folder_info
@@ -2092,7 +2089,7 @@ camel_folder_info_free
camel_folder_info_build
camel_folder_info_clone
camel_store_supports_subscriptions
-camel_store_folder_subscribed
+camel_store_folder_is_subscribed
camel_store_subscribe_folder
camel_store_unsubscribe_folder
camel_store_noop
diff --git a/docs/reference/camel/tmpl/camel-cipher-context.sgml b/docs/reference/camel/tmpl/camel-cipher-context.sgml
index 30bfa70..e25e1e0 100644
--- a/docs/reference/camel/tmpl/camel-cipher-context.sgml
+++ b/docs/reference/camel/tmpl/camel-cipher-context.sgml
@@ -351,6 +351,20 @@ CamelCipherContext
@gpointer cert_data:
@gpointer cert_data:
@gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
+ gpointer cert_data:
@gpointer cert_data:
diff --git a/docs/reference/camel/tmpl/camel-folder.sgml b/docs/reference/camel/tmpl/camel-folder.sgml
index b4c3f66..8dc8a69 100644
--- a/docs/reference/camel/tmpl/camel-folder.sgml
+++ b/docs/reference/camel/tmpl/camel-folder.sgml
@@ -26,6 +26,28 @@ CamelFolder
</para>
+<!-- ##### SIGNAL CamelFolder::changed ##### -->
+<para>
+
+</para>
+
+ camelfolder: the object which received the signal.
+
+<!-- ##### SIGNAL CamelFolder::deleted ##### -->
+<para>
+
+</para>
+
+ camelfolder: the object which received the signal.
+
+<!-- ##### SIGNAL CamelFolder::renamed ##### -->
+<para>
+
+</para>
+
+ camelfolder: the object which received the signal.
+ arg1:
+
<!-- ##### ARG CamelFolder:description ##### -->
<para>
@@ -552,6 +574,15 @@ CamelFolder
@new:
+<!-- ##### FUNCTION camel_folder_changed ##### -->
+<para>
+
+</para>
+
+ folder:
+ changes:
+
+
<!-- ##### FUNCTION camel_folder_freeze ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-object.sgml b/docs/reference/camel/tmpl/camel-object.sgml
index bde393b..c2ac140 100644
--- a/docs/reference/camel/tmpl/camel-object.sgml
+++ b/docs/reference/camel/tmpl/camel-object.sgml
@@ -31,32 +31,6 @@ CamelObject
</para>
-<!-- ##### TYPEDEF CamelObjectHookID ##### -->
-<para>
-
-</para>
-
-
-<!-- ##### USER_FUNCTION CamelObjectEventPrepFunc ##### -->
-<para>
-
-</para>
-
- Param1:
- Param2:
- Returns:
-
-
-<!-- ##### USER_FUNCTION CamelObjectEventHookFunc ##### -->
-<para>
-
-</para>
-
- Param1:
- Param2:
- Param3:
-
-
<!-- ##### ENUM CamelParamFlags ##### -->
<para>
@@ -64,58 +38,6 @@ CamelObject
@CAMEL_PARAM_PERSISTENT:
-<!-- ##### FUNCTION camel_object_class_add_event ##### -->
-<para>
-
-</para>
-
- klass:
- name:
- prep:
-
-
-<!-- ##### FUNCTION camel_object_hook_event ##### -->
-<para>
-
-</para>
-
- obj:
- name:
- hook:
- data:
- Returns:
-
-
-<!-- ##### FUNCTION camel_object_remove_event ##### -->
-<para>
-
-</para>
-
- obj:
- id:
-
-
-<!-- ##### FUNCTION camel_object_unhook_event ##### -->
-<para>
-
-</para>
-
- obj:
- name:
- hook:
- data:
-
-
-<!-- ##### FUNCTION camel_object_trigger_event ##### -->
-<para>
-
-</para>
-
- obj:
- name:
- event_data:
-
-
<!-- ##### FUNCTION camel_object_state_read ##### -->
<para>
diff --git a/docs/reference/camel/tmpl/camel-session.sgml b/docs/reference/camel/tmpl/camel-session.sgml
index ebb3089..316c936 100644
--- a/docs/reference/camel/tmpl/camel-session.sgml
+++ b/docs/reference/camel/tmpl/camel-session.sgml
@@ -26,6 +26,21 @@ CamelSession
</para>
+<!-- ##### ARG CamelSession:check-junk ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG CamelSession:network-available ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG CamelSession:online ##### -->
+<para>
+
+</para>
+
<!-- ##### USER_FUNCTION CamelTimeoutCallback ##### -->
<para>
@@ -180,7 +195,7 @@ CamelSession
@Returns:
-<!-- ##### FUNCTION camel_session_is_online ##### -->
+<!-- ##### FUNCTION camel_session_get_online ##### -->
<para>
</para>
@@ -209,7 +224,7 @@ CamelSession
@Returns:
-<!-- ##### FUNCTION camel_session_check_junk ##### -->
+<!-- ##### FUNCTION camel_session_get_check_junk ##### -->
<para>
</para>
@@ -267,7 +282,7 @@ CamelSession
@id:
-<!-- ##### FUNCTION camel_session_get_network_state ##### -->
+<!-- ##### FUNCTION camel_session_get_network_available ##### -->
<para>
</para>
@@ -276,7 +291,7 @@ CamelSession
@Returns:
-<!-- ##### FUNCTION camel_session_set_network_state ##### -->
+<!-- ##### FUNCTION camel_session_set_network_available ##### -->
<para>
</para>
diff --git a/docs/reference/camel/tmpl/camel-store.sgml b/docs/reference/camel/tmpl/camel-store.sgml
index 11ecfa6..83e87f6 100644
--- a/docs/reference/camel/tmpl/camel-store.sgml
+++ b/docs/reference/camel/tmpl/camel-store.sgml
@@ -26,6 +26,54 @@ CamelStore
</para>
+<!-- ##### SIGNAL CamelStore::folder-created ##### -->
+<para>
+
+</para>
+
+ camelstore: the object which received the signal.
+ Param2:
+
+<!-- ##### SIGNAL CamelStore::folder-deleted ##### -->
+<para>
+
+</para>
+
+ camelstore: the object which received the signal.
+ Param2:
+
+<!-- ##### SIGNAL CamelStore::folder-opened ##### -->
+<para>
+
+</para>
+
+ camelstore: the object which received the signal.
+
+<!-- ##### SIGNAL CamelStore::folder-renamed ##### -->
+<para>
+
+</para>
+
+ camelstore: the object which received the signal.
+ arg1:
+ arg2:
+
+<!-- ##### SIGNAL CamelStore::folder-subscribed ##### -->
+<para>
+
+</para>
+
+ camelstore: the object which received the signal.
+ Param2:
+
+<!-- ##### SIGNAL CamelStore::folder-unsubscribed ##### -->
+<para>
+
+</para>
+
+ camelstore: the object which received the signal.
+ Param2:
+
<!-- ##### STRUCT CamelFolderInfo ##### -->
<para>
@@ -181,14 +229,6 @@ CamelStore
-<!-- ##### STRUCT CamelRenameInfo ##### -->
-<para>
-
-</para>
-
- old_base:
- new:
-
<!-- ##### MACRO CAMEL_STORE_SUBSCRIPTIONS ##### -->
<para>
@@ -385,6 +425,52 @@ CamelStore
@Returns:
+<!-- ##### FUNCTION camel_store_folder_created ##### -->
+<para>
+
+</para>
+
+ store:
+ info:
+
+
+<!-- ##### FUNCTION camel_store_folder_deleted ##### -->
+<para>
+
+</para>
+
+ store:
+ info:
+
+
+<!-- ##### FUNCTION camel_store_folder_renamed ##### -->
+<para>
+
+</para>
+
+ store:
+ old_name:
+ info:
+
+
+<!-- ##### FUNCTION camel_store_folder_subscribed ##### -->
+<para>
+
+</para>
+
+ store:
+ info:
+
+
+<!-- ##### FUNCTION camel_store_folder_unsubscribed ##### -->
+<para>
+
+</para>
+
+ store:
+ info:
+
+
<!-- ##### FUNCTION camel_store_sync ##### -->
<para>
@@ -482,7 +568,7 @@ CamelStore
@Returns:
-<!-- ##### FUNCTION camel_store_folder_subscribed ##### -->
+<!-- ##### FUNCTION camel_store_folder_is_subscribed ##### -->
<para>
</para>
diff --git a/docs/reference/camel/tmpl/camel-unused.sgml b/docs/reference/camel/tmpl/camel-unused.sgml
index 4f23646..0e49b9a 100644
--- a/docs/reference/camel/tmpl/camel-unused.sgml
+++ b/docs/reference/camel/tmpl/camel-unused.sgml
@@ -3624,6 +3624,24 @@ streams
@Param1:
+<!-- ##### USER_FUNCTION CamelObjectEventHookFunc ##### -->
+<para>
+
+</para>
+
+ Param1:
+ Param2:
+ Param3:
+
+<!-- ##### USER_FUNCTION CamelObjectEventPrepFunc ##### -->
+<para>
+
+</para>
+
+ Param1:
+ Param2:
+ Returns:
+
<!-- ##### USER_FUNCTION CamelObjectFinalizeFunc ##### -->
<para>
@@ -3638,6 +3656,12 @@ streams
@CAMEL_OBJECT_DESTROY:
+<!-- ##### TYPEDEF CamelObjectHookID ##### -->
+<para>
+
+</para>
+
+
<!-- ##### USER_FUNCTION CamelObjectInitFunc ##### -->
<para>
@@ -3766,6 +3790,14 @@ streams
@name:
@description:
+<!-- ##### STRUCT CamelRenameInfo ##### -->
+<para>
+
+</para>
+
+ old_base:
+ new:
+
<!-- ##### STRUCT CamelSendmailTransport ##### -->
<para>
@@ -6876,6 +6908,15 @@ streams
@ctype:
@Returns:
+<!-- ##### FUNCTION camel_object_class_add_event ##### -->
+<para>
+
+</para>
+
+ klass:
+ name:
+ prep:
+
<!-- ##### FUNCTION camel_object_class_add_interface ##### -->
<para>
@@ -6967,6 +7008,17 @@ streams
@Param3:
@Returns:
+<!-- ##### FUNCTION camel_object_hook_event ##### -->
+<para>
+
+</para>
+
+ obj:
+ name:
+ hook:
+ data:
+ Returns:
+
<!-- ##### FUNCTION camel_object_is ##### -->
<para>
@@ -7019,6 +7071,14 @@ streams
@Param1:
@Returns:
+<!-- ##### FUNCTION camel_object_remove_event ##### -->
+<para>
+
+</para>
+
+ obj:
+ id:
+
<!-- ##### FUNCTION camel_object_set ##### -->
<para>
@@ -7039,12 +7099,31 @@ streams
@Param3:
@Returns:
+<!-- ##### FUNCTION camel_object_trigger_event ##### -->
+<para>
+
+</para>
+
+ obj:
+ name:
+ event_data:
+
<!-- ##### VARIABLE camel_object_type ##### -->
<para>
</para>
+<!-- ##### FUNCTION camel_object_unhook_event ##### -->
+<para>
+
+</para>
+
+ obj:
+ name:
+ hook:
+ data:
+
<!-- ##### FUNCTION camel_object_unref ##### -->
<para>
@@ -7382,6 +7461,38 @@ streams
@type:
@words:
+<!-- ##### FUNCTION camel_session_check_junk ##### -->
+<para>
+
+</para>
+
+ session:
+ Returns:
+
+<!-- ##### FUNCTION camel_session_get_network_state ##### -->
+<para>
+
+</para>
+
+ session:
+ Returns:
+
+<!-- ##### FUNCTION camel_session_is_online ##### -->
+<para>
+
+</para>
+
+ session:
+ Returns:
+
+<!-- ##### FUNCTION camel_session_set_network_state ##### -->
+<para>
+
+</para>
+
+ session:
+ network_state:
+
<!-- ##### FUNCTION camel_spool_folder_new ##### -->
<para>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]