diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-04-27 20:14:15 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:03 +0800 |
commit | 76b102e4038c63e29e4b427e4bdfe4db720970f2 (patch) | |
tree | 12551ca631f4aca4d51102e80f4872653e43e617 /calendar/gui/dialogs/task-page.c | |
parent | 698e3476e392ea52f95fcea1c899d1dfa6354e8d (diff) | |
download | gsoc2013-evolution-76b102e4038c63e29e4b427e4bdfe4db720970f2.tar gsoc2013-evolution-76b102e4038c63e29e4b427e4bdfe4db720970f2.tar.gz gsoc2013-evolution-76b102e4038c63e29e4b427e4bdfe4db720970f2.tar.bz2 gsoc2013-evolution-76b102e4038c63e29e4b427e4bdfe4db720970f2.tar.lz gsoc2013-evolution-76b102e4038c63e29e4b427e4bdfe4db720970f2.tar.xz gsoc2013-evolution-76b102e4038c63e29e4b427e4bdfe4db720970f2.tar.zst gsoc2013-evolution-76b102e4038c63e29e4b427e4bdfe4db720970f2.zip |
Add itip_get_fallback_identity().
Convenience function returns a name + address string from the default
mail identity, to be used as a fallback for organizers.
Diffstat (limited to 'calendar/gui/dialogs/task-page.c')
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 1120ccf263..bb18780250 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -66,6 +66,7 @@ struct _TaskPagePrivate { GtkWidget *main; gchar **address_strings; + gchar *fallback_address; EMeetingAttendee *ia; gchar *user_add; ECalComponent *comp; @@ -426,6 +427,7 @@ task_page_finalize (GObject *object) priv = TASK_PAGE_GET_PRIVATE (object); g_strfreev (priv->address_strings); + g_free (priv->fallback_address); g_ptr_array_foreach ( priv->deleted_attendees, (GFunc) g_object_unref, NULL); @@ -2036,8 +2038,6 @@ task_page_select_organizer (TaskPage *tpage, const gchar *backend_address) { TaskPagePrivate *priv = tpage->priv; CompEditor *editor; - EAccount *def_account; - gchar *def_address = NULL; const gchar *default_address; gboolean subscribed_cal = FALSE; ESource *source = NULL; @@ -2048,10 +2048,6 @@ task_page_select_organizer (TaskPage *tpage, const gchar *backend_address) editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (tpage)); client = comp_editor_get_client (editor); - def_account = e_get_default_account (); - if (def_account && def_account->enabled) - def_address = g_strdup_printf("%s <%s>", def_account->id->name, def_account->id->address); - if (client) source = e_cal_get_source (client); if (source) @@ -2062,7 +2058,8 @@ task_page_select_organizer (TaskPage *tpage, const gchar *backend_address) else user_addr = (backend_address && *backend_address) ? backend_address : NULL; - default_address = NULL; + default_address = priv->fallback_address; + if (user_addr) { for (ii = 0; priv->address_strings[ii] != NULL; ii++) { if (g_strrstr (priv->address_strings[ii], user_addr) != NULL) { @@ -2072,9 +2069,6 @@ task_page_select_organizer (TaskPage *tpage, const gchar *backend_address) } } - if (!default_address && def_address) - default_address = def_address; - if (default_address) { if (!priv->comp || !e_cal_component_has_organizer (priv->comp)) { GtkEntry *entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->organizer))); @@ -2086,8 +2080,6 @@ task_page_select_organizer (TaskPage *tpage, const gchar *backend_address) } } else g_warning ("No potential organizers!"); - - g_free (def_address); } /** @@ -2130,6 +2122,8 @@ task_page_construct (TaskPage *tpage, model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->organizer)); priv->address_strings = itip_get_user_identities (); + priv->fallback_address = itip_get_fallback_identity (); + for (ii = 0; priv->address_strings[ii] != NULL; ii++) e_dialog_append_list_store_text ( model, 0, priv->address_strings[ii]); |