Re: [Ekiga-devel-list] Ekiga address book searching by URI



Le 16/11/2010 12:59, Eugen Dedu a écrit :
On 16/11/10 08:13, Julien Puydt wrote:
Le 15/11/2010 21:33, Eugen Dedu a écrit :
On 15/11/10 21:32, Julien Puydt wrote:
Le 15/11/2010 21:25, Eugen Dedu a écrit :
On 15/11/10 21:15, Julien Puydt wrote:
What about only the has_uri... and the UI code does the looping [and
hence may stop at any point] ?

Hmm, I would rather say let's have a function get_contact_by_uri which
does the loop; the has_uri is optional (it can be or not).

What do you do in your loop without the has_uri ?

Well, check if it has an URI directly, without using a has_uri function.
But maybe this cannot be done, you know better than me.

Let's create an imaginary but realistic addressbook.

- First contact : (that one has many uris)
Name : Eugen Dedu
E-mail (this is an uri) : eugen dedu org
E-mail (this is an uri) : eugen dedu dedu org
E-mail (this is an uri) : eugen dedu ekiga net
E-mail (this is an uri) : eugen dedu hotmail com
E-mail (this is an uri) : dedu gmail com
SIP (this is an uri) : eugen dedu ekiga net
SIP (this is an uri) : eugen dedu dedu org
SIP (this is an uri) : eugen dedu org
XMPP (this is an uri) : eugen dedu org
XMPP (this is an uri) : dedu jabber org
XMPP (this is an uri) : dedu jabber fr
Adress : somewhere in France

- Second contact (she's 107 years old, never seen a computer, but reads
her snail mail just fine -- not a single uri) :
Name : Cassandra North
Address : somewhere in Canada -- of course in the north!

- Third contact : (shared uri)
Name : Felicia Fish
SIP : family fish bowl com

- Fourth contact : (shared uri)
Name : James Fish
SIP : family fish bowl com

Now we see something like :
const std::string get_uri () const;
doesn't fly : sometimes we have many to return, and sometimes none.

Only this one seems the best for me, since it so simple... If no match,
return "", elsewhere return the contact (if only 1) or one of them (the
first found for ex.) There is no problem if Felicia Fish and James Fish
cannot be distinguished.

Could you tell me which uri your simple get_uri method would return for the first contact?

Snark


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]