diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-04-21 07:06:35 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-04-21 19:45:45 +0800 |
commit | 397aeade0545457dae034b0287049aa1cbeed782 (patch) | |
tree | 00e5f01aaea81e8add946ef0f18130841b07256f /mail/em-folder-tree-model.c | |
parent | 69add830e12856ab29b96bdce7335bf18e0a2a6f (diff) | |
download | gsoc2013-evolution-397aeade0545457dae034b0287049aa1cbeed782.tar.gz gsoc2013-evolution-397aeade0545457dae034b0287049aa1cbeed782.tar.zst gsoc2013-evolution-397aeade0545457dae034b0287049aa1cbeed782.zip |
Adapt to CamelService changes.
Diffstat (limited to 'mail/em-folder-tree-model.c')
-rw-r--r-- | mail/em-folder-tree-model.c | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/mail/em-folder-tree-model.c b/mail/em-folder-tree-model.c index 3455234c7f..7a7a5f8716 100644 --- a/mail/em-folder-tree-model.c +++ b/mail/em-folder-tree-model.c @@ -204,8 +204,7 @@ account_changed_cb (EAccountList *accounts, EMFolderTreeModelStoreInfo *si; EMailSession *session; CamelProvider *provider; - CamelStore *store; - gchar *uri; + CamelService *service; session = em_folder_tree_model_get_session (model); @@ -216,24 +215,25 @@ account_changed_cb (EAccountList *accounts, em_folder_tree_model_remove_store (model, si->store); /* check if store needs to be added at all*/ - if (!account->enabled ||!(uri = account->source->url)) + if (!account->enabled) return; - if (!(provider = camel_provider_get (uri, NULL))) + provider = camel_provider_get (account->source->url, NULL); + if (provider == NULL) return; /* make sure the new store belongs in the tree */ if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE)) return; - store = (CamelStore *) camel_session_get_service ( - CAMEL_SESSION (session), uri, - CAMEL_PROVIDER_STORE, NULL); - if (store == NULL) + service = camel_session_get_service ( + CAMEL_SESSION (session), account->uid); + + if (!CAMEL_IS_STORE (service)) return; - em_folder_tree_model_add_store (model, store, account->name); - g_object_unref (store); + em_folder_tree_model_add_store ( + model, CAMEL_STORE (service), account->name); } static void @@ -257,27 +257,9 @@ account_added_cb (EAccountList *accounts, EMFolderTreeModel *model) { EMailSession *session; - CamelStore *store; - const gchar *uri; session = em_folder_tree_model_get_session (model); - uri = e_account_get_string (account, E_ACCOUNT_SOURCE_URL); - - store = (CamelStore *) camel_session_get_service ( - CAMEL_SESSION (session), uri, CAMEL_PROVIDER_STORE, NULL); - - if (store != NULL) { - CamelService *service; - CamelProvider *provider; - - service = CAMEL_SERVICE (store); - provider = camel_service_get_provider (service); - - if ((provider->flags & CAMEL_PROVIDER_IS_STORAGE) != 0) - e_mail_store_add (session, store, account->name); - - g_object_unref (store); - } + e_mail_store_add_by_account (session, account); } static void |