[evolution] Add em_folder_tree_new_with_model().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Add em_folder_tree_new_with_model().
- Date: Wed, 10 Aug 2011 04:15:06 +0000 (UTC)
commit c961b23dcd1aca98566b3bc0e1d6fe1d2c6c29fb
Author: Matthew Barnes <mbarnes redhat com>
Date: Tue Aug 9 21:38:06 2011 -0400
Add em_folder_tree_new_with_model().
This is so an EMFolderTree can be created with a custom model, such as
perhaps only a subset of available stores added.
mail/em-folder-tree.c | 16 +++++++++++++++-
mail/em-folder-tree.h | 3 +++
2 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 26c08fe..eb7b3e4 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -1779,13 +1779,27 @@ em_folder_tree_new (EMailBackend *backend,
EAlertSink *alert_sink)
{
EMFolderTreeModel *model;
+
+ g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), NULL);
+ g_return_val_if_fail (E_IS_ALERT_SINK (alert_sink), NULL);
+
+ model = em_folder_tree_model_get_default ();
+
+ return em_folder_tree_new_with_model (backend, alert_sink, model);
+}
+
+GtkWidget *
+em_folder_tree_new_with_model (EMailBackend *backend,
+ EAlertSink *alert_sink,
+ EMFolderTreeModel *model)
+{
EMailSession *session;
const gchar *data_dir;
g_return_val_if_fail (E_IS_MAIL_BACKEND (backend), NULL);
g_return_val_if_fail (E_IS_ALERT_SINK (alert_sink), NULL);
+ g_return_val_if_fail (EM_IS_FOLDER_TREE_MODEL (model), NULL);
- model = em_folder_tree_model_get_default ();
session = e_mail_backend_get_session (backend);
data_dir = e_shell_backend_get_data_dir (E_SHELL_BACKEND (backend));
diff --git a/mail/em-folder-tree.h b/mail/em-folder-tree.h
index b351714..eeea8df 100644
--- a/mail/em-folder-tree.h
+++ b/mail/em-folder-tree.h
@@ -92,6 +92,9 @@ struct _EMFolderTreeClass {
GType em_folder_tree_get_type (void);
GtkWidget * em_folder_tree_new (EMailBackend *backend,
EAlertSink *alert_sink);
+GtkWidget * em_folder_tree_new_with_model (EMailBackend *backend,
+ EAlertSink *alert_sink,
+ EMFolderTreeModel *model);
EActivity * em_folder_tree_new_activity (EMFolderTree *folder_tree);
PangoEllipsizeMode
em_folder_tree_get_ellipsize (EMFolderTree *folder_tree);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]