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

List:       kde-pim
Subject:    Re: [Kde-pim] Configurable resource
From:       Tobias Koenig <tokoe82 () yahoo ! de>
Date:       2002-06-02 8:58:08
[Download RAW message or body]

On Sat, Jun 01, 2002 at 11:38:46PM +0200, Cornelius Schumacher wrote:
> On Saturday 01 June 2002 23:06, Tobias Koenig wrote:
> >
> > I commited the newest version of libkabc to cvs a few minutes ago.
> > It supports multiple resources now, which are configureable with
> > a kcontrol modul (Personalization->AddressBook Configuration).
> >
> > StdAddressBook does no longer provide the method fileName(). Is there
> > a programm that use this function?
> 
> Yes, at least kabcfrontend. This also breaks binary compatibility. 
> Please don't remove existing methods.
Ok, I'll add them again, but this function doesn't return any usefull
value atm. Should it return the name (not filename) of the writeable resource?

> > Furthermore StdAddressBook::identifier() returns
> > KApplication::randomString(10).
> 
> That's wrong. A random string can't be used to identify an addressbook 
> as it changes from call to call. This function is e.g. used to 
> associate distribution lists with the corresponding addressbook.
What should be returned instead? A filename is wrong, because when using a sql
backend there is no filename. The name of the writeable resource also lacks,
since this resource could be changed in the meantime.

> What happens, when the addressbook is switched from one resource to the 
> other? Is the addressbook data automatically converted?
No, since you can't switch between them, during executing e.g. kaddressbook.

In the ctor of StdAddressBook the resources are loaded. The first resource,
that is added by addResource() is the 'writeable' resource. So all new entries
will append to this resource. All following resources are readonly. There
entries will be added to AddressBook, but when syncing the addressbook, there
will be no changes to the readonly resources.

For converting between the different backends we could provide a standalone
program, that execute the following code


	AddressBook ab;
	Resource *oldFormat = new ResourceXXX(&ab,...);
	Resource *newFormat = new ResourceYYY(&ab,...);
	ab.addResource(oldFormat);
	ab.load();
	ab.addResource(newFormat);
	AddressBook::Iterator it;
	for (it = ab.begin(); it != ab.end(); ++it)
		(*it).setResource(0); // mark all entries as new

	ab.save( ab.requestSaveTicket(newFormat) );

Ciao,
Tobias
-- 
In a world without walls and fences who
needs Windows and Gates???
_______________________________________________
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