aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/event-page.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/dialogs/event-page.c')
-rw-r--r--calendar/gui/dialogs/event-page.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index a4856b1792..d2fc4ae091 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -110,6 +110,7 @@ struct _EventPagePrivate {
GtkWidget *location_label;
gchar **address_strings;
+ gchar *fallback_address;
EMeetingAttendee *ia;
gchar *user_add;
ECalComponent *comp;
@@ -897,6 +898,7 @@ event_page_finalize (GObject *object)
priv = EVENT_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);
@@ -3186,18 +3188,12 @@ event_page_select_organizer (EventPage *epage, const gchar *backend_address)
EventPagePrivate *priv = epage->priv;
CompEditor *editor;
ECal *client;
- EAccount *def_account;
- gchar *def_address = NULL;
const gchar *default_address;
gboolean subscribed_cal = FALSE;
ESource *source = NULL;
const gchar *user_addr = NULL;
gint ii;
- 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);
-
editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (epage));
client = comp_editor_get_client (editor);
@@ -3211,7 +3207,8 @@ event_page_select_organizer (EventPage *epage, 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) {
@@ -3221,10 +3218,7 @@ event_page_select_organizer (EventPage *epage, const gchar *backend_address)
}
}
- if (!default_address && def_address)
- default_address = def_address;
-
- if (default_address) {
+ if (default_address != NULL) {
if (!priv->comp || !e_cal_component_has_organizer (priv->comp)) {
GtkEntry *entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->organizer)));
@@ -3235,8 +3229,6 @@ event_page_select_organizer (EventPage *epage, const gchar *backend_address)
}
} else
g_warning ("No potential organizers!");
-
- g_free (def_address);
}
/**
@@ -3276,6 +3268,8 @@ event_page_construct (EventPage *epage,
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]);