aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/tasks-component.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2004-01-07 02:35:30 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2004-01-07 02:35:30 +0800
commit1c1c77da5d7fe009e054bca28a9b2e04dff92a01 (patch)
tree990491cabf9bfbc3d257bc2a82a570ab8c660e50 /calendar/gui/tasks-component.c
parent0651968c803dfcb75c401ddf425a34633637deb0 (diff)
downloadgsoc2013-evolution-1c1c77da5d7fe009e054bca28a9b2e04dff92a01.tar.gz
gsoc2013-evolution-1c1c77da5d7fe009e054bca28a9b2e04dff92a01.tar.zst
gsoc2013-evolution-1c1c77da5d7fe009e054bca28a9b2e04dff92a01.zip
new method's implementation. (calendar_component_class_init): initialize
2004-01-06 Rodrigo Moya <rodrigo@ximian.com> * gui/calendar-component.c (impl_upgradeFromVersion): new method's implementation. (calendar_component_class_init): initialize new epv's member. (calendar_component_init): moved migration code to impl_upgradeFromVersion. (update_uri_for_primary_selection): fixed warning. * gui/tasks-component.c (impl_upgradeFromVersion): new method's implementation. (tasks_component_class_init): initialize new epv's member. (tasks_component_init): moved migration code to impl_upgradeFromVersion. svn path=/trunk/; revision=24074
Diffstat (limited to 'calendar/gui/tasks-component.c')
-rw-r--r--calendar/gui/tasks-component.c74
1 files changed, 44 insertions, 30 deletions
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
index f41ff908f7..55eef10dc2 100644
--- a/calendar/gui/tasks-component.c
+++ b/calendar/gui/tasks-component.c
@@ -493,6 +493,49 @@ impl_finalize (GObject *object)
/* Evolution::Component CORBA methods */
static void
+impl_upgradeFromVersion (PortableServer_Servant servant,
+ CORBA_short major,
+ CORBA_short minor,
+ CORBA_short revision,
+ CORBA_Environment *ev)
+{
+ TasksComponentPrivate *priv;
+ GSList *groups;
+ TasksComponent *component = TASKS_COMPONENT (bonobo_object_from_servant (servant));
+
+ priv = component->priv;
+
+ /* create default tasks folders if there are no groups */
+ groups = e_source_list_peek_groups (priv->source_list);
+ if (!groups) {
+ ESourceGroup *group;
+ ESource *source;
+ char *base_uri, *new_dir;
+
+ /* create the source group */
+ base_uri = g_build_filename (g_get_home_dir (),
+ ".evolution/tasks/local/OnThisComputer/",
+ NULL);
+ group = e_source_group_new (_("On This Computer"), base_uri);
+ e_source_list_add_group (priv->source_list, group, -1);
+
+ /* migrate tasks from older setup */
+ if (!migrate_old_tasks (group)) {
+ /* create default tasks folders */
+ new_dir = g_build_filename (base_uri, "Personal/", NULL);
+ if (!e_mkdir_hier (new_dir, 0700)) {
+ source = e_source_new (_("Personal"), "Personal");
+ e_source_group_add_source (group, source, -1);
+ }
+
+ g_free (new_dir);
+ }
+
+ g_free (base_uri);
+ }
+}
+
+static void
impl_createControls (PortableServer_Servant servant,
Bonobo_Control *corba_sidebar_control,
Bonobo_Control *corba_view_control,
@@ -734,6 +777,7 @@ tasks_component_class_init (TasksComponentClass *klass)
parent_class = g_type_class_peek_parent (klass);
+ epv->upgradeFromVersion = impl_upgradeFromVersion;
epv->createControls = impl_createControls;
epv->_get_userCreatableItems = impl__get_userCreatableItems;
epv->requestCreateItem = impl_requestCreateItem;
@@ -746,7 +790,6 @@ static void
tasks_component_init (TasksComponent *component, TasksComponentClass *klass)
{
TasksComponentPrivate *priv;
- GSList *groups;
priv = g_new0 (TasksComponentPrivate, 1);
priv->config_directory = g_build_filename (g_get_home_dir (),
@@ -758,35 +801,6 @@ tasks_component_init (TasksComponent *component, TasksComponentClass *klass)
priv->source_list = e_source_list_new_for_gconf (priv->gconf_client,
"/apps/evolution/tasks/sources");
- /* create default tasks folders if there are no groups */
- groups = e_source_list_peek_groups (priv->source_list);
- if (!groups) {
- ESourceGroup *group;
- ESource *source;
- char *base_uri, *new_dir;
-
- /* create the source group */
- base_uri = g_build_filename (g_get_home_dir (),
- ".evolution/tasks/local/OnThisComputer/",
- NULL);
- group = e_source_group_new (_("On This Computer"), base_uri);
- e_source_list_add_group (priv->source_list, group, -1);
-
- /* migrate tasks from older setup */
- if (!migrate_old_tasks (group)) {
- /* create default tasks folders */
- new_dir = g_build_filename (base_uri, "Personal/", NULL);
- if (!e_mkdir_hier (new_dir, 0700)) {
- source = e_source_new (_("Personal"), "Personal");
- e_source_group_add_source (group, source, -1);
- }
-
- g_free (new_dir);
- }
-
- g_free (base_uri);
- }
-
component->priv = priv;
}