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

List:       kde-commits
Subject:    Re: [messagelib/Applications/16.08] messagecore/src/utils: Reduce number of identitymanager created
From:       laurent Montel <montel () kde ! org>
Date:       2016-08-01 4:47:03
Message-ID: 1604384.sLgM5jsoLq () linux-5nvn
[Download RAW message or body]

Le lundi 1 août 2016, 00:46:04 CEST David Faure a écrit :
> Why not use the new IdentityManager::self(), if you want to keep the logic
> about when to show "Me" ?

How do you use it ?
It's not static method. So I need to create a new identity manager to use it 
no ? Otherwise I missed something.

Regards.

> 
> On samedi 30 juillet 2016 12:58:18 CEST Montel Laurent wrote:
> > Git commit cb6d59b4afda9ee247b172248d855a664799e95c by Montel Laurent.
> > Committed on 30/07/2016 at 12:58.
> > Pushed by mlaurent into branch 'Applications/16.08'.
> > 
> > Reduce number of identitymanager created
> > 
> > M  +2    -2    messagecore/src/utils/stringutil.cpp
> > 
> > http://commits.kde.org/messagelib/cb6d59b4afda9ee247b172248d855a664799e95c
> > 
> > diff --git a/messagecore/src/utils/stringutil.cpp
> > b/messagecore/src/utils/stringutil.cpp index ba0b9e7..1bdb00c 100644
> > --- a/messagecore/src/utils/stringutil.cpp
> > +++ b/messagecore/src/utils/stringutil.cpp
> > @@ -386,7 +386,7 @@ QString emailAddrAsAnchor(const
> > KMime::Types::Mailbox::List &mailboxList, QString result;
> > 
> >      int numberAddresses = 0;
> >      bool expandableInserted = false;
> > 
> > -    KIdentityManagement::IdentityManager im(true);
> > +    //KIdentityManagement::IdentityManager im(true);
> > 
> >      foreach (const KMime::Types::Mailbox &mailbox, mailboxList) {
> >      
> >          if (!mailbox.prettyAddress().isEmpty()) {
> > 
> > @@ -404,7 +404,7 @@ QString emailAddrAsAnchor(const
> > KMime::Types::Mailbox::List &mailboxList, +
> > QString::fromLatin1(QUrl::toPercentEncoding(KEmailAddress::encodeMailtoUrl
> > (
> > mailbox.prettyAddress(KMime::Types::Mailbox::QuoteWhenNecessary)).path()))
> > + QLatin1String("\" ") + cssStyle + QLatin1Char('>'); }
> > -            const bool foundMe = (im.identities().count() == 1) &&
> > (im.identityForAddress(mailbox.prettyAddress()) !=
> > KIdentityManagement::Identity::null()); +            const bool foundMe =
> > false;//(im.identities().count() == 1) &&
> > (im.identityForAddress(mailbox.prettyAddress()) !=
> > KIdentityManagement::Identity::null()); const QString i18nMe =
> > i18nc("signal that this email is defined in my identity", "Me"); if
> > (display == DisplayNameOnly) {
> > 
> >                  if (!mailbox.name().isEmpty()) { // Fallback to the email
> > 
> > address when the name is not set.


-- 
Laurent Montel | laurent.montel@kdab.com | KDE/Qt Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53,  http://www.kdab.fr


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

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