aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar-component.c22
-rw-r--r--calendar/gui/tasks-component.c3
2 files changed, 23 insertions, 2 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index ed3b389697..399a3558bf 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -239,7 +239,7 @@ update_primary_selection (CalendarComponent *calendar_component)
ESource *source;
/* Try to create a default if there isn't one */
- source = find_first_source (priv->source_list);
+ source = e_source_list_peek_source_any (priv->source_list);
if (source)
e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (priv->source_selector), source);
}
@@ -522,6 +522,7 @@ impl_upgradeFromVersion (PortableServer_Servant servant,
/* create the remote source group */
group = e_source_group_new (_("On The Web"), "webcal://");
e_source_list_add_group (priv->source_list, group, -1);
+ e_source_list_sync (priv->source_list, NULL);
}
if (major == 1 && minor <= 4) {
@@ -544,6 +545,7 @@ impl_upgradeFromVersion (PortableServer_Servant servant,
}
g_free (new_dir);
}
+ e_source_list_sync (priv->source_list, NULL);
g_free (base_uri);
@@ -565,8 +567,24 @@ impl_upgradeFromVersion (PortableServer_Servant servant,
e_source_group_add_source (group, source, -1);
e_source_group_set_readonly (group, TRUE);
e_source_list_add_group (priv->source_list, group, -1);
+ e_source_list_sync (priv->source_list, NULL);
}
+ /* create calendar for birthdays & anniversaries */
+ if ((major < 0) ||
+ ((major == 1) && (minor < 5)) ||
+ ((major == 1) && (minor == 5) && (revision < 2))) {
+ ESource *source;
+ char *base_uri, *new_dir;
+
+ group = e_source_group_new (_("Birthdays"), "contacts://");
+ source = e_source_new (_("Birthdays & Anniversaries"), "/");
+ e_source_group_add_source (group, source, -1);
+ e_source_group_set_readonly (group, TRUE);
+ e_source_list_add_group (priv->source_list, group, -1);
+ e_source_list_sync (priv->source_list, NULL);
+ }
+
return CORBA_TRUE;
}
@@ -742,7 +760,7 @@ setup_create_ecal (CalendarComponent *calendar_component)
if (!priv->create_ecal) {
/* Try to create a default if there isn't one */
- source = find_first_source (priv->source_list);
+ source = e_source_list_peek_source_any (priv->source_list);
if (source)
priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT);
}
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
index fcd57d7fe2..dfb668ac7f 100644
--- a/calendar/gui/tasks-component.c
+++ b/calendar/gui/tasks-component.c
@@ -518,6 +518,7 @@ impl_upgradeFromVersion (PortableServer_Servant servant,
/* create the source group */
group = e_source_group_new (_("On This Computer"), base_uri);
e_source_list_add_group (priv->source_list, group, -1);
+ e_source_list_sync (priv->source_list, NULL);
}
if (major == 1 && minor <= 4) {
@@ -534,6 +535,8 @@ impl_upgradeFromVersion (PortableServer_Servant servant,
g_free (new_dir);
}
+
+ e_source_list_sync (priv->source_list, NULL);
}
g_free (base_uri);