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

List:       kde-core-devel
Subject:    Re: [PATCH] Cache returned KIconLoader pixmaps in 4.5.2
From:       Matthias Fuchs <mat69 () gmx ! net>
Date:       2010-09-15 7:45:44
Message-ID: 201009150945.59364.mat69 () gmx ! net
[Download RAW message or body]


Am Montag 13 September 2010, 12:02:35 schrieb Torgny Nyblom:
> On Mon, 13 Sep 2010 11:36:15 +0200
> 
> Matthias Fuchs <mat69@gmx.net> wrote:
> > I just realised that I sent an outdated patch, here is a newer one.
> 
> [...]
> 
> > @@ -756,26 +757,9 @@
> > 
> >  QString KIconLoaderPrivate::makeCacheKey(const QString &name,
> > 
> > KIconLoader::Group group, const QStringList &overlays, int size, int
> > state) const {
> > -    // The KSharedDataCache is shared so add some namespacing.
> > -    QString key;
> > -
> > -    if (group == KIconLoader::User) {
> > -        key = QLatin1String("$kicou_");
> > -    }
> > -    else {
> > -        key = QLatin1String("$kico_");
> > -    }
> > -
> > -   
> > key.append(QString("%1_%2_%3").arg(name).arg(size).arg(overlays.join("_"
> > ))); -
> > -    if (group >= 0) {
> > -        key.append(mpEffect.fingerprint(group, state));
> > -    }
> > -    else {
> > -        key.append(QLatin1String("noeffect"));
> > -    }
> > -
> > -    return key;
> > +    return (group == KIconLoader::User ? QLatin1Literal("$kicou_") :
> > QLatin1Literal("$kico_")) % +           name % QLatin1Char('_') %
> > QString::number(size) % QLatin1Char('_') % overlays.join("_") % +       
> >    (group >= 0 ? mpEffect.fingerprint(group, state) :
> > QString("noeffect"));//QString here, since ternary operator does not
> > support different classes
> > 
> >  }
> >  QImage KIconLoaderPrivate::createIconImage(const QString &path, int
> >  size)
> 
> Sorry but do you really think this makes the code more readable?

That's not what I wrote.

Though Ingo is right to make it into more lines, looks a lot nicer when my 
packed stuff.

["signature.asc" (application/pgp-signature)]

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

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