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

List:       kopete-devel
Subject:    [Kopete-devel] addContact parentContact default
From:       Jason Keirstead <jason () keirstead ! org>
Date:       2003-01-03 18:58:36
[Download RAW message or body]

I think it finally hit me where the communications breakdown has been in regard to 

bool addContact( const QString &contactId, const QString &displayName = \
QString::null,  KopeteMetaContact *parentContact = 0L, const QString &groupName = \
QString::null, bool isTemporary = false);

(Gof, changed to bool as per suggestion)

, and Martijn's suggestion that parentContact should not have a default, since it \
always has to exist.

You guys keep thinking of the process as

1) Create metacontact
2) Add Contact

I keep thinking of it as

1) Create contact

That is why I have the parentContact defaulted to 0L, because the addContact 
method creates him if he does not exist already. The way I picture it is this way
you can just call addContact() and ensure that everything will get done, you dont
have to create the parent beforehand. 

The only one of the four times where a contact is added where you might be adding 
it to an existing metacontact is from the AddContactWizard page. In the other three 
times, our code has now been reduced since we don't have to create the metacontact 
and put him in the groups, make him temporary, etc ourselves beforehand, since it is \
all encapsulated in the API. As well, this hasn't added any extra code in the \
AddContact wizard, since we had the parentContact already anyway. So we have suceeded \
in  encapsulating a bunch of common code into the API with no cost. That is why I \
have the parentContact with a default... because most of the time I envision calling \
the addContact() method without having a parentContact already, and just having it \
created.

-- 
Jason Keirstead, BCS
http://www.keirstead.org
_______________________________________________
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