diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2014-03-26 21:57:02 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2014-03-27 08:24:34 +0800 |
commit | 613f58f7764b4802f7fd098ae295281ffb5443a3 (patch) | |
tree | d360a88e2ca1cbea884d2322b2e1bb8395d44582 /mail | |
parent | 79920ca23f382587c67c9d5034a29f57f49d0c76 (diff) | |
download | gsoc2013-evolution-613f58f7764b4802f7fd098ae295281ffb5443a3.tar gsoc2013-evolution-613f58f7764b4802f7fd098ae295281ffb5443a3.tar.gz gsoc2013-evolution-613f58f7764b4802f7fd098ae295281ffb5443a3.tar.bz2 gsoc2013-evolution-613f58f7764b4802f7fd098ae295281ffb5443a3.tar.lz gsoc2013-evolution-613f58f7764b4802f7fd098ae295281ffb5443a3.tar.xz gsoc2013-evolution-613f58f7764b4802f7fd098ae295281ffb5443a3.tar.zst gsoc2013-evolution-613f58f7764b4802f7fd098ae295281ffb5443a3.zip |
Add em_folder_selector_set_selected().
Mostly a convenience function so callers don't have to dig up the
dialog's folder tree widget.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/em-folder-selector.c | 28 | ||||
-rw-r--r-- | 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 e3e2c597dc..9761871fcf 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 a1207e8013..c5f37e2867 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); |