aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree-model.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r--mail/em-folder-tree-model.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c
index 222c1cebd7..37552bb555 100644
--- a/mail/em-folder-tree-model.c
+++ b/mail/em-folder-tree-model.c
@@ -35,10 +35,6 @@
#include <glib/gi18n.h>
-#include <camel/camel-file-utils.h>
-
-#include "e-mail-store.h"
-
#include "mail-config.h"
#include "mail-session.h"
#include "mail-tools.h"
@@ -52,10 +48,8 @@
#include "em-folder-utils.h"
#include "em-event.h"
-#include <camel/camel-folder.h>
-#include <camel/camel-vee-store.h>
-
#include "e-mail-local.h"
+#include "e-mail-store.h"
#include "shell/e-shell.h"
#define d(x)
@@ -106,14 +100,14 @@ 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);
- camel_object_unref (si->store);
+ g_object_unref (si->store);
gtk_tree_row_reference_free (si->row);
g_hash_table_destroy (si->full_hash);
g_free (si);
@@ -243,7 +237,7 @@ account_changed_cb (EAccountList *accounts,
}
em_folder_tree_model_add_store (model, store, account->name);
- camel_object_unref (store);
+ g_object_unref (store);
}
static void
@@ -693,7 +687,7 @@ em_folder_tree_model_set_folder_info (EMFolderTreeModel *model,
unread = total > 0 ? total : 0;
}
- camel_object_unref(folder);
+ g_object_unref (folder);
}
/* TODO Maybe this should be handled by mail_get_folderinfo
@@ -875,7 +869,7 @@ folder_subscribed (CamelStore *store,
g_signal_emit (model, signals[FOLDER_ADDED], 0, fi->full_name, fi->uri);
done:
- camel_object_unref (store);
+ g_object_unref (store);
camel_folder_info_free (fi);
}
@@ -886,7 +880,7 @@ folder_subscribed_cb (CamelStore *store,
{
CamelFolderInfo *fi;
- camel_object_ref (store);
+ g_object_ref (store);
fi = camel_folder_info_clone (event_data);
mail_async_event_emit (
@@ -919,7 +913,7 @@ folder_unsubscribed (CamelStore *store,
em_folder_tree_model_remove_folders (model, si, &iter);
done:
- camel_object_unref (store);
+ g_object_unref (store);
camel_folder_info_free (fi);
}
@@ -930,7 +924,7 @@ folder_unsubscribed_cb (CamelStore *store,
{
CamelFolderInfo *fi;
- camel_object_ref (store);
+ g_object_ref (store);
fi = camel_folder_info_clone (event_data);
mail_async_event_emit (
@@ -950,7 +944,7 @@ folder_created_cb (CamelStore *store,
if (camel_store_supports_subscriptions (store))
return;
- camel_object_ref (store);
+ g_object_ref (store);
fi = camel_folder_info_clone (event_data);
mail_async_event_emit (
@@ -970,7 +964,7 @@ folder_deleted_cb (CamelStore *store,
if (camel_store_supports_subscriptions (store))
return;
- camel_object_ref (store);
+ g_object_ref (store);
fi = camel_folder_info_clone (event_data);
mail_async_event_emit (
@@ -978,9 +972,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;
@@ -1003,7 +1002,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;
@@ -1026,7 +1025,7 @@ folder_renamed (CamelStore *store,
em_folder_tree_model_set_folder_info (model, &iter, si, info->new, TRUE);
done:
- camel_object_unref (store);
+ g_object_unref (store);
g_free (info->old_base);
camel_folder_info_free (info->new);
@@ -1035,16 +1034,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;
- camel_object_ref (store);
+ 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)
@@ -1095,7 +1095,7 @@ em_folder_tree_model_add_store (EMFolderTreeModel *model,
si = g_new (EMFolderTreeModelStoreInfo, 1);
si->display_name = g_strdup (display_name);
- camel_object_ref (store);
+ g_object_ref (store);
si->store = store;
si->account = account;
si->row = gtk_tree_row_reference_copy (reference);
@@ -1127,21 +1127,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);