Le vendredi 28 mai 2010 à 19:17 -0400, Chris Frey a écrit :
> Hi Nicolas,
> 
> Sorry for the delay, but thanks for the patches!
> 
> I've applied the first two, which were obvious bugfixes.  Thanks!
> 
> As for the calendar ID patch, some issues:
> 
> 1) Pulling data from the Blackberry should go through the btohll() macro.

> 2) Calendar::Clear() should set the new CalendarID to -1 as a default,
>       instead of in the constructor, so that the user can reset
>       the record to default values himself.

OK, I'm going to fix these. (sse git)

> 3) If I understand the logic of your patch correctly, it saves a copy
>       of one of the calendar records as it goes from BB -> VCal.
>       Then when new data comes from VCal -> BB, it uses this
>       saved record as the Calendar ID.

Exact.
When I modify a BB event from VCal, I read at first the BB event to
extract some field (today only the CalendarID field).
We can think using this solution for other data.

>       What happens if there really are multiple calendars?  Won't this
>       overwrite things, or potentially put certain calendar data in
>       the wrong calendar?

I have 4 calendars :
- mail1 - CalendarID = 12345
- mail2 - CalendarID = 34567
- BlackBerry Messenger Group - CalendarID = 56789
- default - CalendarID = -1  (not associated to mail account => so the
function "invited participant" is disabled)

Before my patch :

- If I add a new event in Evolution (so VCal -> BB direction), BB uses
the rules defined in the menu "Options > Advanced Options > Default
services". From this menu, I have set the default calendar to "mail1".
(but the default calendar name exists always)
- If I edit an existant event in Evolution (so VCal -> BB direction), BB
set CalendarID to -1. My event is moved to the "default calendar". (so
in a wrong calendar) => So, after an other sync, opensync removes the
event in evolution since the event isn't more in the good calendar.

With the patch :
- If I add a new event in Evolution (so VCal -> BB direction), I set the
CalendarID value to -1. So I don't build this field. BB uses the rules
defined in the menu "Options > Advanced Options > Default services".
- If I edit an existant event in Evolution (so VCal -> BB direction), I
read at first the BB event to extract CalendID field. Then I build the
BB event and I set the CalendarID field with the good value (except if
the value is -1). So, my event isn't moved in an other calendar !

>       What if there are no new records in the BB -> VCal direction?
>       Will the VCal -> BB step have a Calendar ID, or just the default?

On my device (Storm with 0S 5), the CalendarID has always a value. The
default calendar is always -1 (0xffff...). (same on the wife's curve)

> I think we need to think about how to sync multiple calendars into another
> application.  Does opensync support such a concept?  I don't think it does.

No. In fact, we should have :
    <Resource>
      <ID>1</ID>       <= New XML field
      <Enabled>1</Enabled>
      <Formats>
        <Format>
          <Name>vevent20</Name>
        </Format>
      </Formats>
      <ObjType>event</ObjType>
      <Url>file:///home/nicolas/.evolution/calendar/local/system</Url>
    </Resource>
    <Resource>
      <ID>2</ID>       <= New XML field
      <Enabled>1</Enabled>
      <Formats>
        <Format>
          <Name>vevent20</Name>
        </Format>
      </Formats>
      <ObjType>event</ObjType>
      <Url>file:///home/nicolas/.evolution/calendar/local/others</Url>
    </Resource>

    <Resource>
      <ID>1</ID>       <= New XML field
      <Enabled>1</Enabled>
      <Formats>
        <Format>
          <Name>vevent20</Name>
        </Format>
      </Formats>
      <Name>Event</Name>
      <ObjType>event</ObjType>
      <DataBase>0x15</DataBase>
    </Resource>
    <Resource>
      <ID>2</ID>       <= New XML field
      <Enabled>1</Enabled>
      <Formats>
        <Format>
          <Name>vevent20</Name>
        </Format>
      </Formats>
      <Name>Event</Name>
      <ObjType>event</ObjType>
      <DataBase>0x16</DataBase>
    </Resource>

We need a link between objetcts and be able to choose the database for
barry sync.

> Perhaps we need a plugin config setting, to let the user decide what
> calendar he wishes to sync, instead of just assuming a default.

If the user creates an entry from BB, he can choose the calendar.
If the user creates an entry from VCal (evolution or other), BB use the
services profile.

> Is there an extra database in your device that lists the available
> calendars?  It would be good to add a parser for that, so we can connect
> CalendarID's with email addresses.  If you can post a 'btool -d' hex dump
> of the records, maybe we can analyze the format together.

It's quiet simple.

You have two database :
      Database: 0xa 'Calendar - All' (records: 32)
      Database: 0x16 'Calendar' (records: 31)

Calendar - All contains all events (whatever the calendar)
Calendar contains only the event linked to default services choose by
the user in the options. (in my case, "mail1").

I prepare a dump to write a parser.

Regards,

Nicolas




------------------------------------------------------------------------------

_______________________________________________
Barry-devel mailing list
Barry-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/barry-devel

Reply via email to