[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] libkabc API problems
From:       Cornelius Schumacher <schumacher () kde ! org>
Date:       2002-09-29 21:22:12
[Download RAW message or body]

On Sunday 29 September 2002 16:45, Reinhold Kainhofer wrote:
>
> Anyway, using the StdAddressBook for the conduit has an inherent
> flaw: The StdAddressBook can contain read-only resources, while you
> can always change the addressees on your handheld. Syncing these
> contacts will then fail miserably (well, not miserably, but the two
> contacts will not be in sync any longer). So I actually thought about
> letting the user select which resources to sync to (and not offering
> read-only resources). Then however, I wouldn't have such a simple
> ::saveAll() routine. I guess your suggestion then is to iterate
> through all resources of the addressbook and explicitely call a save
> on them? Or did I misunderstand something?

No, the applicationhas to decide which resources it syncs anyway. So it 
already knows which resources have changed and can save these.

> I would hate that, because I thought one of the rationales behind
> kabc was that the developers had to work with resources as little as
> possible. After initializing the addressbook with several resources
> (and maybe setting a default resource if that is not obvious), I fail
> to see why the developer should be bothered with resources again.
> Especially for saving it is clear to me that all resources should be
> saved.

If there are multiple writable resources in an addressbook, the 
application (in some cases even the user) has to decide to which 
resource a new addressee is written. There is no way how libkabc could 
decide these automatically, otherwise the concept of having multiple 
writable resources would be void.

The problem with the locking is that an application syncing data with 
the standard addressbook relies on the fact that the standard 
addressbook doesn't change during the syncing operation. The saveAll() 
(and also the StdAddressBook::save()) don't provide this. If the 
addressbook is read, then synced and then written back, any changes 
done to the addressbook by another app after the syncing app has read 
the addressbook will be overwritten.

-- 
Cornelius Schumacher <schumacher@kde.org>
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic