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

List:       kopete-devel
Subject:    Re: [Kopete-devel] KopeteContactList::findContact  api change?
From:       Olivier Goffart <ogoffart () tiscalinet ! be>
Date:       2002-08-27 9:22:04
[Download RAW message or body]

>contra-argument: code duplication in all plugins.
>
>Hence I tend to object.
>
>Is this really needed or can we fix the problem without adding code 
>duplication and split code paths in all plugins?

yes, it will be necessary to add code in all plugins, but there are only two 
lines moreover 

I think that KopeteContactList::contactList()->addMetaContact(mc); do not have 
its place in findContact, it will have arrived later, when the contact itself 
was created.

in each protocols, findcontact is used in this manner for creating contacts:

KopeteContactList *l = KopeteContactList::contactList();
KopeteMetaContact *m = l->findContact( this->id(), QString::null, userID );
KopeteContact *c = m->findContact( this->id(), QString::null, userID );
if(c) // Existing contact, update data
else // create new contact

I propose just

KopeteContactList *l = KopeteContactList::contactList();
KopeteMetaContact *m = l->findContact( this->id(), QString::null, userID );
if(m) // Existing contact, update data
else // create new contact

If m exists then c should inevitably exist 

I hope that you understand me, sorry for my bad English

--
Olivier Goffart

_______________________________________________
Kopete-devel mailing list
Kopete-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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