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

List:       kde-pim
Subject:    Re: [Kde-pim] problem with name in libkabc
From:       Cornelius Schumacher <schumacher () kde ! org>
Date:       2002-09-05 20:49:36
[Download RAW message or body]

On Thursday 05 September 2002 18:19, Tobias Koenig wrote:
> On Thu, Sep 05, 2002 at 12:33:23AM +0200, Cornelius Schumacher wrote:
> > On Monday 02 September 2002 13:02, Tobias Koenig wrote:
> > > since I've changed formattedName() to get rid with a bug in
> > > KAddressBook the documentation for KABC::Addressee is not correct
> > > anymore.
> > >
> > > realName() doesn't return formattedName() if one is present.
> >
> > Hmm, I don't understand. CVS tells me that neiver realName() nor
> > formattedName() have been changed for a long time.
>
> I've changed the behaviour one day before the long time :)
> In former versions realName() checked if formattedName() is empty,
> and if that's not the case it returned the formatted name instead of
> the joined name parts.

Ok. Then you have to change it back to the original behaviour. The 
documented behaviour of realName() was to get the best possible name 
representation and that's obviously a formatted name, if one is set, 
because that exactly reflects how the user would like to see that name. 
realName might not be the best name for this function, but it now has 
this name and will keep it.

> This caused a problem in kaddressbook, because I couldn't get the
> _real_ realName() if already a formattedName was set.
>
> > > Maybe formattedName() should return realName() if no formatted
> > > name is explicitly set? But that would cause a new problem in the
> > > formatted name combo box in kaddressbook :(
> >
> > formattedName() should return the formatted name as it is set, or
> > nothing if it isn't set. How KAddressbook handles formatted names
> > is something different.
>
> Hmm, maybe we should introduce a method displayName() that returns
> the formattedName() or if it's empty the realName(). So the
> programmer don't have to care about if a formatted name is set when
> he wants to display the name somewhere.

I would propose to introduce a function assembledName() which returns a 
concatenation of the name parts. It shouldn't do anything different, 
i.e. not fall back to name() or formattedName(), just put the name 
parts together in a reasonable way.

-- 
Cornelius Schumacher <schumacher@kde.org>
_______________________________________________
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