diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-24 23:55:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-05-24 23:55:19 +0800 |
commit | 1d7900e57e97f75096a43f5a942b44bbc1df4c77 (patch) | |
tree | 75fd262cadabbde8f0c5bada53ee960ca12564b2 /mail/em-folder-tree.c | |
parent | ff9fcffeca2bdc37a91e0c2f0cb51f871a3cd7a1 (diff) | |
download | gsoc2013-evolution-1d7900e57e97f75096a43f5a942b44bbc1df4c77.tar.gz gsoc2013-evolution-1d7900e57e97f75096a43f5a942b44bbc1df4c77.tar.zst gsoc2013-evolution-1d7900e57e97f75096a43f5a942b44bbc1df4c77.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/em-folder-tree.c')
-rw-r--r-- | mail/em-folder-tree.c | 25 |
1 files changed, 25 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) { |