[Evolution-hackers] e_cal_new_system_calendar() - creates a new calendar each time?

2011-04-07 Thread Patrick Ohly
Hello!

I noticed that in 2.32/MeeGo, e_cal_new_system_calendar() always creates
a new calendar, although there is already one.

It is defined in gconf as:

group uid=1300454894.7178.0@pohly-mobl1 name=On This Computer
base_uri=local: readonly=nosource
uid=1300454894.7178.4@pohly-mobl1 name=Personal
relative_uri=system color_spec=#BECEDD//group

The sequence of events is this:
 1. e_cal_new_system_calendar()
 2. e_cal_new_from_uri(local:system, ...
 3. get source list
 4. search_known_sources() by comparing e_source_peek_absolute_uri()
against local:system
 5. no source found, create anew

Step 4 fails because there is no absolute URI:

(gdb) p source-priv-absolute_uri
$11 = (gchar *) 0x0
(gdb) p source-priv-relative_uri
$12 = (gchar *) 0x8079450 system

Therefore e_source_peek_absolute_uri() returns NULL and the comparison
fails.

What is the root cause for this issue, and how should it be fixed?

-- 
Bye, Patrick Ohly
--  
patrick.o...@gmx.de
http://www.estamos.de/


___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] e_cal_new_system_calendar() - creates a new calendar each time?

2011-04-07 Thread Patrick Ohly
On Do, 2011-04-07 at 10:47 +0200, Patrick Ohly wrote:
 Hello!
 
 I noticed that in 2.32/MeeGo, e_cal_new_system_calendar() always creates
 a new calendar, although there is already one.
 
 It is defined in gconf as:
 
 group uid=1300454894.7178.0@pohly-mobl1 name=On This Computer
 base_uri=local: readonly=nosource
 uid=1300454894.7178.4@pohly-mobl1 name=Personal
 relative_uri=system color_spec=#BECEDD//group
 
 The sequence of events is this:
  1. e_cal_new_system_calendar()
  2. e_cal_new_from_uri(local:system, ...
  3. get source list
  4. search_known_sources() by comparing e_source_peek_absolute_uri()
 against local:system
  5. no source found, create anew
 
 Step 4 fails because there is no absolute URI:
 
 (gdb) p source-priv-absolute_uri
 $11 = (gchar *) 0x0
 (gdb) p source-priv-relative_uri
 $12 = (gchar *) 0x8079450 system
 
 Therefore e_source_peek_absolute_uri() returns NULL and the comparison
 fails.
 
 What is the root cause for this issue, and how should it be fixed?

absolute_uri is taken from the uri property, so adding that to the
gconf sources works around the issue.

Perhaps dump_common_to_xml_node() and the code after
/* do not store absolute uris for local:system sources */
is to blame?

Or if uri is correctly not set, then
e_cal_new_system_calendar()/e_cal_new_from_uri() must be fixed to cope
with that?

One more oddity: on the client side, e_source_get_uri() for the system
calendar returns local:/system. What is the correct absolute URI for
the local system calendar?


-- 
Bye, Patrick Ohly
--  
patrick.o...@gmx.de
http://www.estamos.de/


___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] e_cal_new_system_calendar() - creates a new calendar each time?

2011-04-07 Thread Matthew Barnes
On Thu, 2011-04-07 at 10:47 +0200, Patrick Ohly wrote: 
 The sequence of events is this:
  1. e_cal_new_system_calendar()
  2. e_cal_new_from_uri(local:system, ...
  3. get source list
  4. search_known_sources() by comparing e_source_peek_absolute_uri()
 against local:system
  5. no source found, create anew
 
 Step 4 fails because there is no absolute URI:
 
 (gdb) p source-priv-absolute_uri
 $11 = (gchar *) 0x0
 (gdb) p source-priv-relative_uri
 $12 = (gchar *) 0x8079450 system
 
 Therefore e_source_peek_absolute_uri() returns NULL and the comparison
 fails.

Perhaps it should be calling e_source_get_uri() instead, which either
returns the explicit absolute URI or constructs one from the group's
base URI + the source's relative URI.

The absolute URI for the system calendar is local:system.  There
should be no slash.  That's a bug.

___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers