From d502cc9f842d4530d11645c1c3bf5f47db7eb9db Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 28 Mar 2011 10:16:00 -0400 Subject: Adapt publish-calendar plugin to the new ESource API. --- plugins/publish-calendar/url-editor-dialog.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'plugins/publish-calendar/url-editor-dialog.c') diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c index 35910db8c7..ea697fd185 100644 --- a/plugins/publish-calendar/url-editor-dialog.c +++ b/plugins/publish-calendar/url-editor-dialog.c @@ -29,12 +29,15 @@ #include #include +#include #include #include #include #include +#include + G_DEFINE_TYPE ( UrlEditorDialog, url_editor_dialog, @@ -350,13 +353,12 @@ set_from_uri (UrlEditorDialog *dialog) static gboolean url_editor_dialog_construct (UrlEditorDialog *dialog) { + EShell *shell; GtkWidget *toplevel; GtkWidget *content_area; - GConfClient *gconf; GtkSizeGroup *group; EPublishUri *uri; - - gconf = gconf_client_get_default (); + ESourceRegistry *registry; dialog->builder = gtk_builder_new (); e_load_ui_builder_definition (dialog->builder, "publish-calendar.ui"); @@ -408,8 +410,10 @@ url_editor_dialog_construct (UrlEditorDialog *dialog) gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); - dialog->events_source_list = e_source_list_new_for_gconf (gconf, "/apps/evolution/calendar/sources"); - dialog->events_selector = e_source_selector_new (dialog->events_source_list); + shell = e_shell_get_default (); + registry = e_shell_get_registry (shell); + dialog->events_selector = e_source_selector_new ( + registry, E_SOURCE_EXTENSION_CALENDAR); gtk_widget_show (dialog->events_selector); gtk_container_add (GTK_CONTAINER (dialog->events_swin), dialog->events_selector); @@ -440,10 +444,14 @@ url_editor_dialog_construct (UrlEditorDialog *dialog) GSList *p; for (p = uri->events; p; p = g_slist_next (p)) { - gchar *source_uid = g_strdup (p->data); - source = e_source_list_peek_source_by_uid (dialog->events_source_list, source_uid); - e_source_selector_select_source ((ESourceSelector *) dialog->events_selector, source); - g_free (source_uid); + const gchar *uid = p->data; + + source = e_source_registry_ref_source ( + registry, uid); + e_source_selector_select_source ( + E_SOURCE_SELECTOR (dialog->events_selector), + source); + g_object_unref (source); } if (uri->location && strlen (uri->location)) { @@ -503,8 +511,6 @@ url_editor_dialog_construct (UrlEditorDialog *dialog) dialog->remember_pw, "toggled", G_CALLBACK (remember_pw_toggled), dialog); - g_object_unref (gconf); - check_input (dialog); return TRUE; -- cgit v1.2.3