diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-24 23:55:19 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:20 +0800 |
commit | 6a810a5114d84c86294542c627e5d52d045dfd5f (patch) | |
tree | b7aa6a2a7fa2acd1c16ca07bbcc8b46b11c1f828 /mail | |
parent | 672132f8a0098b029cf999f79b605058ee8796d1 (diff) | |
download | gsoc2013-evolution-6a810a5114d84c86294542c627e5d52d045dfd5f.tar.gz gsoc2013-evolution-6a810a5114d84c86294542c627e5d52d045dfd5f.tar.zst gsoc2013-evolution-6a810a5114d84c86294542c627e5d52d045dfd5f.zip |
Add em_folder_tree_new_activity().
Similar to e_mail_reader_new_activity(). Creates, configures and
submits a new EActivity instance, so asynchronous operations can easily
be dispatched without a lot of boilerplate code.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/em-folder-tree.c | 25 | ||||
-rw-r--r-- | mail/em-folder-tree.h | 1 |
2 files changed, 26 insertions, 0 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 8d856c12e5..aa15a797d6 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -1767,6 +1767,31 @@ em_folder_tree_new (EMailBackend *backend, "backend", backend, NULL); } +EActivity * +em_folder_tree_new_activity (EMFolderTree *folder_tree) +{ + EActivity *activity; + EMailBackend *backend; + EAlertSink *alert_sink; + GCancellable *cancellable; + + g_return_val_if_fail (EM_IS_FOLDER_TREE (folder_tree), NULL); + + activity = e_activity_new (); + + alert_sink = em_folder_tree_get_alert_sink (folder_tree); + e_activity_set_alert_sink (activity, alert_sink); + + cancellable = camel_operation_new (); + e_activity_set_cancellable (activity, cancellable); + g_object_unref (cancellable); + + backend = em_folder_tree_get_backend (folder_tree); + e_shell_backend_add_activity (E_SHELL_BACKEND (backend), activity); + + return activity; +} + PangoEllipsizeMode em_folder_tree_get_ellipsize (EMFolderTree *folder_tree) { diff --git a/mail/em-folder-tree.h b/mail/em-folder-tree.h index d2cd643d37..0e6eba4659 100644 --- a/mail/em-folder-tree.h +++ b/mail/em-folder-tree.h @@ -92,6 +92,7 @@ struct _EMFolderTreeClass { GType em_folder_tree_get_type (void); GtkWidget * em_folder_tree_new (EMailBackend *backend, EAlertSink *alert_sink); +EActivity * em_folder_tree_new_activity (EMFolderTree *folder_tree); PangoEllipsizeMode em_folder_tree_get_ellipsize (EMFolderTree *folder_tree); void em_folder_tree_set_ellipsize (EMFolderTree *folder_tree, |