[evolution] Add em_folder_selector_set_selected().



commit 613f58f7764b4802f7fd098ae295281ffb5443a3
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Mar 26 09:57:02 2014 -0400

    Add em_folder_selector_set_selected().
    
    Mostly a convenience function so callers don't have to dig up the
    dialog's folder tree widget.

 mail/em-folder-selector.c |   28 ++++++++++++++++++++++++++++
 mail/em-folder-selector.h |    3 +++
 2 files changed, 31 insertions(+), 0 deletions(-)
---
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c
index e3e2c59..9761871 100644
--- a/mail/em-folder-selector.c
+++ b/mail/em-folder-selector.c
@@ -790,6 +790,34 @@ em_folder_selector_get_selected (EMFolderSelector *selector,
                folder_tree, out_store, out_folder_name);
 }
 
+/**
+ * em_folder_selector_set_selected:
+ * @selector: an #EMFolderSelector
+ * @store: a #CamelStore
+ * @folder_name: a folder name
+ *
+ * Selects the folder given by @store and @folder_name in the @selector
+ * dialog.
+ **/
+void
+em_folder_selector_set_selected (EMFolderSelector *selector,
+                                 CamelStore *store,
+                                 const gchar *folder_name)
+{
+       gchar *folder_uri;
+
+       g_return_if_fail (EM_IS_FOLDER_SELECTOR (selector));
+       g_return_if_fail (CAMEL_IS_STORE (store));
+       g_return_if_fail (folder_name != NULL);
+
+       folder_uri = e_mail_folder_uri_build (store, folder_name);
+
+       em_folder_tree_set_selected (
+               selector->priv->folder_tree, folder_uri, FALSE);
+
+       g_free (folder_uri);
+}
+
 const gchar *
 em_folder_selector_get_selected_uri (EMFolderSelector *selector)
 {
diff --git a/mail/em-folder-selector.h b/mail/em-folder-selector.h
index a1207e8..c5f37e2 100644
--- a/mail/em-folder-selector.h
+++ b/mail/em-folder-selector.h
@@ -87,6 +87,9 @@ EMFolderTree *        em_folder_selector_get_folder_tree
 gboolean       em_folder_selector_get_selected (EMFolderSelector *selector,
                                                 CamelStore **out_store,
                                                 gchar **out_folder_name);
+void           em_folder_selector_set_selected (EMFolderSelector *selector,
+                                                CamelStore *store,
+                                                const gchar *folder_name);
 const gchar *  em_folder_selector_get_selected_uri
                                                (EMFolderSelector *selector);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]