Code review comment for lp:~mspacek/qpdfview/cachezoom

Revision history for this message
Martin Spacek (mspacek) wrote :

"Forgot something as it won't work like that since this would still be
the key and not the hash, i.e. we would have to collision-free w.r.t.
the second member and that seems are rather harsh requirement, so back
to "struct CacheKey" I'd say. Sorry for my thinking going off the rails..."

Hm, this is starting to sound a bit complicated. OK, so a CacheKey struct should be defined in global.h like this:

struct CacheKey
{
 PageItem* pageItem;
 RenderParam renderParam;
 QRect rect;
};

and it needs to be given a qHash method so that QCache knows how to hash it?

How does this solve the problem of removing from the QCache all the keys associated with a specific PageItem that we want to destroy?

« Back to merge proposal