diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-03-28 09:16:56 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-03-28 10:08:48 +0800 |
commit | 4c5e629f518fa03610e69c970337d9f7d625a50b (patch) | |
tree | a6713e509a2db09b6361d7ea9c1a74fdeace0267 /calendar | |
parent | 5ece5b9483db0ca246eea687c4e883d38306aff4 (diff) | |
download | gsoc2013-evolution-4c5e629f518fa03610e69c970337d9f7d625a50b.tar gsoc2013-evolution-4c5e629f518fa03610e69c970337d9f7d625a50b.tar.gz gsoc2013-evolution-4c5e629f518fa03610e69c970337d9f7d625a50b.tar.bz2 gsoc2013-evolution-4c5e629f518fa03610e69c970337d9f7d625a50b.tar.lz gsoc2013-evolution-4c5e629f518fa03610e69c970337d9f7d625a50b.tar.xz gsoc2013-evolution-4c5e629f518fa03610e69c970337d9f7d625a50b.tar.zst gsoc2013-evolution-4c5e629f518fa03610e69c970337d9f7d625a50b.zip |
Bug 696715 - ESelectNamesEditable needs an EClientCache
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/e-select-names-editable.c | 12 | ||||
-rw-r--r-- | calendar/gui/e-select-names-editable.h | 2 | ||||
-rw-r--r-- | calendar/gui/e-select-names-renderer.c | 7 |
3 files changed, 10 insertions, 11 deletions
diff --git a/calendar/gui/e-select-names-editable.c b/calendar/gui/e-select-names-editable.c index b9a2b1ddc0..2cc4a767b3 100644 --- a/calendar/gui/e-select-names-editable.c +++ b/calendar/gui/e-select-names-editable.c @@ -49,19 +49,13 @@ e_select_names_editable_init (ESelectNamesEditable *esne) } GtkWidget * -e_select_names_editable_new (void) +e_select_names_editable_new (EClientCache *client_cache) { - EShell *shell; - - /* Might be cleaner to have 'registry' passed in, but the call chain - * of this widget doesn't have access that low in the functions, thus - * making the change without (private) API break. */ - shell = e_shell_get_default (); + g_return_val_if_fail (E_IS_CLIENT_CACHE (client_cache), NULL); return g_object_new ( E_TYPE_SELECT_NAMES_EDITABLE, - "registry", e_shell_get_registry (shell), - NULL); + "client-cache", client_cache, NULL); } gchar * diff --git a/calendar/gui/e-select-names-editable.h b/calendar/gui/e-select-names-editable.h index 84e499b632..6fae41a085 100644 --- a/calendar/gui/e-select-names-editable.h +++ b/calendar/gui/e-select-names-editable.h @@ -62,7 +62,7 @@ struct _ESelectNamesEditableClass { GType e_select_names_editable_get_type (void) G_GNUC_CONST; -GtkWidget * e_select_names_editable_new (void); +GtkWidget * e_select_names_editable_new (EClientCache *client_cache); gchar * e_select_names_editable_get_email (ESelectNamesEditable *esne); GList * e_select_names_editable_get_emails diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c index 8450d9b6af..0154745d7c 100644 --- a/calendar/gui/e-select-names-renderer.c +++ b/calendar/gui/e-select-names-renderer.c @@ -225,6 +225,7 @@ select_names_renderer_start_editing (GtkCellRenderer *cell, { ESelectNamesRenderer *sn_cell = E_SELECT_NAMES_RENDERER (cell); GtkCellRendererText *text_cell = GTK_CELL_RENDERER_TEXT (cell); + EClientCache *client_cache; GtkWidget *editable; gboolean is_editable; gfloat xalign; @@ -237,7 +238,9 @@ select_names_renderer_start_editing (GtkCellRenderer *cell, if (!is_editable) return NULL; - editable = e_select_names_editable_new (); + client_cache = e_select_names_renderer_ref_client_cache (sn_cell); + + editable = e_select_names_editable_new (client_cache); gtk_entry_set_has_frame (GTK_ENTRY (editable), FALSE); gtk_entry_set_alignment (GTK_ENTRY (editable), xalign); if (sn_cell->priv->email != NULL && *sn_cell->priv->email != '\0') @@ -254,6 +257,8 @@ select_names_renderer_start_editing (GtkCellRenderer *cell, sn_cell->priv->editable = g_object_ref (editable); sn_cell->priv->path = g_strdup (path); + g_object_unref (client_cache); + return GTK_CELL_EDITABLE (editable); } |