diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-04-21 07:06:35 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:55 +0800 |
commit | 0be9b1f878c2f54a0c7f2f5024125813022d81b1 (patch) | |
tree | 29e3c02eb85eb6c0059d7160821f09930bbf9b44 /plugins/groupwise-features/share-folder-common.c | |
parent | 7b71f8f18c283032a9edf2f2a191e2c693cb2a61 (diff) | |
download | gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar.gz gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar.bz2 gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar.lz gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar.xz gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.tar.zst gsoc2013-evolution-0be9b1f878c2f54a0c7f2f5024125813022d81b1.zip |
Adapt to CamelService changes.
Diffstat (limited to 'plugins/groupwise-features/share-folder-common.c')
-rw-r--r-- | plugins/groupwise-features/share-folder-common.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/plugins/groupwise-features/share-folder-common.c b/plugins/groupwise-features/share-folder-common.c index 521bd3a54c..19d46bad0b 100644 --- a/plugins/groupwise-features/share-folder-common.c +++ b/plugins/groupwise-features/share-folder-common.c @@ -249,7 +249,8 @@ users_dialog_response (GtkWidget *dialog, gint response, struct ShareInfo *ssi) EMFolderSelector *emfs = ssi->emfs; const gchar *uri, *path; EMailSession *session; - CamelStore *store; + CamelService *service = NULL; + CamelURL *url; if (response != GTK_RESPONSE_OK) { gtk_widget_destroy ((GtkWidget *) emfs); @@ -263,18 +264,24 @@ users_dialog_response (GtkWidget *dialog, gint response, struct ShareInfo *ssi) d(printf ("Creating new folder: %s (%s)\n", path, uri)); - store = (CamelStore *) camel_session_get_service ( - CAMEL_SESSION (session), uri, CAMEL_PROVIDER_STORE, NULL); - if (store == NULL) + url = camel_url_new (uri, NULL); + if (url != NULL) { + service = camel_session_get_service_by_url ( + CAMEL_SESSION (session), url); + camel_url_free (url); + } + + if (!CAMEL_IS_STORE (service)) return; - if (!(si = em_folder_tree_model_lookup_store_info (ssi->model, store))) { + si = em_folder_tree_model_lookup_store_info ( + ssi->model, CAMEL_STORE (service)); + if (si == NULL) { g_assert_not_reached (); - g_object_unref (store); return; } - if (CAMEL_IS_VEE_STORE (store)) { + if (CAMEL_IS_VEE_STORE (service)) { EFilterRule *rule; rule = em_vfolder_rule_new (session); @@ -287,7 +294,6 @@ users_dialog_response (GtkWidget *dialog, gint response, struct ShareInfo *ssi) create_folder (si->store, path, new_folder_created_cb, ssi); } - g_object_unref (store); } static void @@ -299,7 +305,8 @@ new_folder_response (EMFolderSelector *emfs, gint response, EMFolderTreeModel *m struct ShareInfo *ssi; const gchar *uri; EGwConnection *cnc; - CamelStore *store; + CamelService *service = NULL; + CamelURL *url; ssi = g_new0 (struct ShareInfo, 1); if (response != GTK_RESPONSE_OK) { @@ -309,12 +316,17 @@ new_folder_response (EMFolderSelector *emfs, gint response, EMFolderTreeModel *m /* i want store at this point to get cnc not sure proper or not*/ uri = em_folder_selector_get_selected_uri (emfs); - store = (CamelStore *) camel_session_get_service ( - session, uri, CAMEL_PROVIDER_STORE, NULL); - if (store == NULL) + + url = camel_url_new (uri, NULL); + if (url != NULL) { + service = camel_session_get_service_by_url (session, url); + camel_url_free (url); + } + + if (!CAMEL_IS_STORE (service)) return; - cnc = get_cnc (store); + cnc = get_cnc (CAMEL_STORE (service)); users_dialog = gtk_dialog_new_with_buttons ( _("Users"), NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); w = gtk_label_new_with_mnemonic (_("Enter the users and set permissions")); @@ -330,10 +342,6 @@ new_folder_response (EMFolderSelector *emfs, gint response, EMFolderTreeModel *m gtk_window_resize (GTK_WINDOW (users_dialog), 350, 300); gtk_widget_show (users_dialog); g_signal_connect (users_dialog, "response", G_CALLBACK (users_dialog_response), ssi); - - g_object_unref (store); - return; - } void |