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

List:       kde-pim
Subject:    Re: [Kde-pim] KPIM Workspace
From:       Don Sanders <sanders () kde ! org>
Date:       2002-06-12 3:09:07
[Download RAW message or body]

On Tuesday 11 June 2002 20:52, Don Sanders wrote:
...
> IMO KAddressBook should be responsible for maintaining (saving,
> updating, loading) this (these) sorted index files.

On seconds thoughts, libkabc should be responsible for this as well.

So I guess what I'm suggesting is making,

    Addressee AddressBook::findByUid( const QString & );

fast, by just loading and parsing a single addressee.

And adding some methods,
  // returns number of Addressee's in the AddressBook. 
   int count AddressBook::count(); 

   // Ensure the AddressBook is indexed by @param field then return 
   // the @param index'th element sorting by @param field. 
   // If @param ascending is true then sort by ascending order 
   // else sort in descending order.
   Addressee findByField( int index, QString field = someGoodDefaultLikeFileAs, bool ascending = true );

and maybe something like:
   // If @param on is true index the AddressBook by @param field, else
   // if @param on is false do not index the addressbook by @param field. 
   // Returns true on success, false if the backend does not support index'ing.
   bool indexByField( QString field, bool on );

   // Returns true iff the AddressBook is indexed by @param field.
   bool isIndexedByField( QString field );


Cornelius any thoughts? The reason why I mention this is because the lack of 
such an API is a design limitation, making kabc non-scalable. And even more
 importantly the lack of such an API encourages KAddressBook code to be 
written in a way that is non-scalable. If the KAddresBook views aren't 
written efficiently then KAddressBook will be slow no matter how fast 
kabc is.

Implementation wise I don't have time to do this now. I'm working on
some KMail code, once that's ready to submit hopefully in a couple of 
weeks then I could have time to work on this.

BTW in my last mail I suggested using a QValueList to hold the sorted uids 
but obviously a QValueVector should really be used.

Don.

_______________________________________________
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