aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog12
-rw-r--r--calendar/gui/dialogs/event-page.c29
-rw-r--r--calendar/gui/dialogs/task-page.c25
3 files changed, 45 insertions, 21 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 78014243c0..3668f5f9b7 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,15 @@
+2007-09-10 Chenthill Palanisamy <pchenthill@novell.com>
+
+ Fixes #270605
+ * gui/dialogs/event-page.c: (event_page_select_organizer),
+ (event_page_construct):
+ * gui/dialogs/task-page.c: (task_page_select_organizer),
+ (task_page_construct): Skip disabled accounts and choose first available address as
+ organizer.
+
+ Reworked the patch from Milan Crha <mcrha@redhat.com> to apply properly as the previous
+ commit made changes in the same area.
+
2007-09-09 Suman Manjunath <msuman@novell.com>
* gui/dialogs/event-page.c: (event_page_init),
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 44ea244dce..9562675f6a 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -1084,7 +1084,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
}
if (e_cal_get_static_capability (COMP_EDITOR_PAGE (epage)->client, CAL_STATIC_CAPABILITY_NO_ORGANIZER) && (COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE))
- string = g_strdup (priv->user_add);
+ string = g_strdup (backend_addr);
else if ( organizer.cn != NULL)
string = g_strdup_printf ("%s <%s>", organizer.cn, strip);
else
@@ -2739,7 +2739,7 @@ source_changed_cb (GtkWidget *widget, ESource *source, gpointer data)
e_cal_get_cal_address(client, &backend_addr, NULL);
- if (backend_addr && priv->is_meeting)
+ if (priv->is_meeting)
event_page_select_organizer (epage, backend_addr);
set_subscriber_info_string (epage, backend_addr);
@@ -3147,13 +3147,13 @@ event_page_select_organizer (EventPage *epage, const char *backend_address)
EventPagePrivate *priv;
GList *l;
EAccount *def_account;
- const char *def_address;
+ const char *def_address = NULL;
gboolean subscribed_cal = FALSE;
ESource *source = NULL;
const char *user_addr = NULL;
def_account = itip_addresses_get_default();
- if (def_account)
+ if (def_account && def_account->enabled)
def_address = g_strdup_printf("%s <%s>", def_account->id->name, def_account->id->address);
priv = epage->priv;
@@ -3165,16 +3165,17 @@ event_page_select_organizer (EventPage *epage, const char *backend_address)
if (user_addr)
subscribed_cal = TRUE;
else
- user_addr = backend_address;
+ user_addr = (backend_address && *backend_address) ? backend_address : NULL;
priv->default_address = NULL;
- for (l = priv->address_strings; l != NULL; l = l->next)
- if (g_strrstr ((gchar *) l->data, user_addr) != NULL) {
- priv->default_address = (gchar *) l->data;
- break;
- }
+ if (user_addr)
+ for (l = priv->address_strings; l != NULL && user_addr; l = l->next)
+ if (g_strrstr ((gchar *) l->data, user_addr) != NULL) {
+ priv->default_address = (gchar *) l->data;
+ break;
+ }
- if (!priv->default_address && def_account)
+ if (!priv->default_address && def_address)
priv->default_address = def_address;
if (priv->default_address) {
@@ -3234,6 +3235,12 @@ event_page_construct (EventPage *epage, EMeetingStore *model, ECal *client)
gchar *full = NULL;
a = (EAccount *)e_iterator_get(it);
+
+
+ /* skip disabled accounts */
+ if (!a->enabled)
+ continue;
+
full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
priv->address_strings = g_list_append(priv->address_strings, full);
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index ef63889a93..33a32bbd54 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -1737,7 +1737,7 @@ source_changed_cb (GtkWidget *widget, ESource *source, gpointer data)
e_cal_get_cal_address(client, &backend_addr, NULL);
- if (backend_addr && priv->is_assignment)
+ if (priv->is_assignment)
task_page_select_organizer (tpage, backend_addr);
set_subscriber_info_string (tpage, backend_addr);
@@ -1913,13 +1913,13 @@ task_page_select_organizer (TaskPage *tpage, const char *backend_address)
TaskPagePrivate *priv;
GList *l;
EAccount *def_account;
- const char *def_address;
+ const char *def_address = NULL;
gboolean subscribed_cal = FALSE;
ESource *source = NULL;
const char *user_addr = NULL;
def_account = itip_addresses_get_default();
- if (def_account)
+ if (def_account && def_account->enabled)
def_address = g_strdup_printf("%s <%s>", def_account->id->name, def_account->id->address);
priv = tpage->priv;
@@ -1931,16 +1931,17 @@ task_page_select_organizer (TaskPage *tpage, const char *backend_address)
if (user_addr)
subscribed_cal = TRUE;
else
- user_addr = backend_address;
+ user_addr = (backend_address && *backend_address) ? backend_address : NULL;
priv->default_address = NULL;
- for (l = priv->address_strings; l != NULL; l = l->next)
- if (g_strrstr ((gchar *) l->data, user_addr) != NULL) {
- priv->default_address = (gchar *) l->data;
- break;
- }
+ if (user_addr)
+ for (l = priv->address_strings; l != NULL && user_addr; l = l->next)
+ if (g_strrstr ((gchar *) l->data, user_addr) != NULL) {
+ priv->default_address = (gchar *) l->data;
+ break;
+ }
- if (!priv->default_address && def_account)
+ if (!priv->default_address && def_address)
priv->default_address = def_address;
if (priv->default_address) {
@@ -2000,6 +2001,10 @@ task_page_construct (TaskPage *tpage, EMeetingStore *model, ECal *client)
gchar *full = NULL;
a = (EAccount *)e_iterator_get(it);
+
+ if (!a->enabled)
+ continue;
+
full = g_strdup_printf("%s <%s>", a->id->name, a->id->address);
priv->address_strings = g_list_append(priv->address_strings, full);