aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree-model.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-05-06 09:47:44 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-05-08 06:32:16 +0800
commit8ad0c51edff9677ca22c46257f4a596dc23d2055 (patch)
tree44a10f1bb10506aba1c373aeae55deea6f3bef15 /mail/em-folder-tree-model.c
parent27eb820ea13c49af3d4f67c4c483aa0d3bbc1a94 (diff)
downloadgsoc2013-evolution-8ad0c51edff9677ca22c46257f4a596dc23d2055.tar.gz
gsoc2013-evolution-8ad0c51edff9677ca22c46257f4a596dc23d2055.tar.zst
gsoc2013-evolution-8ad0c51edff9677ca22c46257f4a596dc23d2055.zip
Adapt to Camel API changes.
This also removes the boxed CamelObject GType, since CamelObject is an honest-to-goodness GObject now.
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r--mail/em-folder-tree-model.c54
1 files changed, 30 insertions, 24 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 0f6ba84b0f..e7262db9d0 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -97,11 +97,11 @@ static guint signals[LAST_SIGNAL];
static void
store_info_free (EMFolderTreeModelStoreInfo *si)
{
- camel_object_remove_event (si->store, si->created_id);
- camel_object_remove_event (si->store, si->deleted_id);
- camel_object_remove_event (si->store, si->renamed_id);
- camel_object_remove_event (si->store, si->subscribed_id);
- camel_object_remove_event (si->store, si->unsubscribed_id);
+ g_signal_handler_disconnect (si->store, si->created_id);
+ g_signal_handler_disconnect (si->store, si->deleted_id);
+ g_signal_handler_disconnect (si->store, si->renamed_id);
+ g_signal_handler_disconnect (si->store, si->subscribed_id);
+ g_signal_handler_disconnect (si->store, si->unsubscribed_id);
g_free (si->display_name);
g_object_unref (si->store);
@@ -941,9 +941,14 @@ folder_deleted_cb (CamelStore *store,
folder_unsubscribed_cb, store, fi, model);
}
+typedef struct {
+ gchar *old_base;
+ CamelFolderInfo *new;
+} RenameInfo;
+
static void
folder_renamed (CamelStore *store,
- CamelRenameInfo *info,
+ RenameInfo *info,
EMFolderTreeModel *model)
{
EMFolderTreeModelStoreInfo *si;
@@ -966,7 +971,7 @@ folder_renamed (CamelStore *store,
em_folder_tree_model_remove_folders (model, si, &iter);
- parent = g_strdup(info->new->full_name);
+ parent = g_strdup (info->new->full_name);
p = strrchr(parent, '/');
if (p)
*p = 0;
@@ -998,16 +1003,17 @@ done:
static void
folder_renamed_cb (CamelStore *store,
- gpointer event_data,
+ const gchar *old_name,
+ CamelFolderInfo *info,
EMFolderTreeModel *model)
{
- CamelRenameInfo *rinfo, *info = event_data;
+ RenameInfo *rinfo;
g_object_ref (store);
- rinfo = g_new0 (CamelRenameInfo, 1);
- rinfo->old_base = g_strdup (info->old_base);
- rinfo->new = camel_folder_info_clone (info->new);
+ rinfo = g_new0 (RenameInfo, 1);
+ rinfo->old_base = g_strdup (old_name);
+ rinfo->new = camel_folder_info_clone (info);
mail_async_event_emit (
mail_async_event, MAIL_ASYNC_GUI, (MailAsyncFunc)
@@ -1090,21 +1096,21 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model,
-1);
/* listen to store events */
- si->created_id = camel_object_hook_event (
- store, "folder_created",
- (CamelObjectEventHookFunc) folder_created_cb, model);
- si->deleted_id = camel_object_hook_event (
- store, "folder_deleted",
- (CamelObjectEventHookFunc) folder_deleted_cb, model);
- si->renamed_id = camel_object_hook_event (
+ si->created_id = g_signal_connect (
+ store, "folder-created",
+ G_CALLBACK (folder_created_cb), model);
+ si->deleted_id = g_signal_connect (
+ store, "folder-deleted",
+ G_CALLBACK (folder_deleted_cb), model);
+ si->renamed_id = g_signal_connect (
store, "folder_renamed",
- (CamelObjectEventHookFunc) folder_renamed_cb, model);
- si->subscribed_id = camel_object_hook_event (
+ G_CALLBACK (folder_renamed_cb), model);
+ si->subscribed_id = g_signal_connect (
store, "folder_subscribed",
- (CamelObjectEventHookFunc) folder_subscribed_cb, model);
- si->unsubscribed_id = camel_object_hook_event (
+ G_CALLBACK (folder_subscribed_cb), model);
+ si->unsubscribed_id = g_signal_connect (
store, "folder_unsubscribed",
- (CamelObjectEventHookFunc) folder_unsubscribed_cb, model);
+ G_CALLBACK (folder_unsubscribed_cb), model);
g_signal_emit (model, signals[LOADED_ROW], 0, path, &root);
gtk_tree_path_free (path);