[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:       David Faure <faure () kde ! org>
Date:       2016-07-31 22:46:04
Message-ID: 1652291.xh8LVZXZea () asterixp50
[Download RAW message or body]

Why not use the new IdentityManager::self(), if you want to keep the logic 
about when to show "Me" ?

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.


-- 
David Faure, faure@kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5

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

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