diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-08-12 20:58:50 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-08-12 23:44:37 +0800 |
commit | 6be2668e483cfc7a2e75ae2efcd9675388d08601 (patch) | |
tree | 3f0d28830d54da205467bf973eea9895f8003b35 /mail/em-folder-tree.c | |
parent | 6456e814fae763ecd9dbdbe4d3caa952ddca0a3d (diff) | |
download | gsoc2013-evolution-6be2668e483cfc7a2e75ae2efcd9675388d08601.tar.gz gsoc2013-evolution-6be2668e483cfc7a2e75ae2efcd9675388d08601.tar.zst gsoc2013-evolution-6be2668e483cfc7a2e75ae2efcd9675388d08601.zip |
Adapt to CamelSession API changes.
These functions now return new references:
camel_session_add_service()
camel_session_list_services()
These functions have been renamed and also return new references:
camel_session_get_service() -> camel_session_ref_service()
camel_session_get_service_by_url() -> camel_session_ref_service_by_url()
Diffstat (limited to 'mail/em-folder-tree.c')
-rw-r--r-- | mail/em-folder-tree.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index fd5ac582e2..ddcfc65c15 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -491,7 +491,7 @@ static void folder_tree_expand_node (const gchar *key, EMFolderTree *folder_tree) { - struct _EMFolderTreeModelStoreInfo *si; + struct _EMFolderTreeModelStoreInfo *si = NULL; GtkTreeRowReference *row; GtkTreeView *tree_view; GtkTreeModel *model; @@ -517,21 +517,18 @@ folder_tree_expand_node (const gchar *key, session = em_folder_tree_get_session (folder_tree); - service = camel_session_get_service (CAMEL_SESSION (session), uid); - - if (!CAMEL_IS_STORE (service)) - return; + service = camel_session_ref_service (CAMEL_SESSION (session), uid); - g_object_ref (service); + if (CAMEL_IS_STORE (service)) + si = em_folder_tree_model_lookup_store_info ( + EM_FOLDER_TREE_MODEL (model), + CAMEL_STORE (service)); - si = em_folder_tree_model_lookup_store_info ( - EM_FOLDER_TREE_MODEL (model), CAMEL_STORE (service)); - if (si == NULL) { + if (service != NULL) g_object_unref (service); - return; - } - g_object_unref (service); + if (si == NULL) + return; if (p != NULL && p[1]) { if (!(row = g_hash_table_lookup (si->full_hash, p + 1))) @@ -3516,12 +3513,14 @@ em_folder_tree_restore_state (EMFolderTree *folder_tree, CamelService *service; const gchar *uid = group_name + 6; - service = camel_session_get_service ( + service = camel_session_ref_service ( CAMEL_SESSION (session), uid); if (CAMEL_IS_STORE (service)) { store = g_object_ref (service); success = TRUE; } + if (service != NULL) + g_object_unref (service); expanded = TRUE; } else if (g_str_has_prefix (group_name, "Folder ")) { |