Review Request: QIcon'ize KoRecentDocumentsPane, fetch big previews only on demand (save memory)

Friedrich W. H. Kossebau kossebau at kde.org
Thu Jul 5 14:18:13 BST 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/105428/
-----------------------------------------------------------

(Updated July 5, 2012, 1:18 p.m.)


Review request for Calligra.


Changes
-------

As it seems noone has reviewed this patch yet, let's just add the big-preview-on-on-demand fetching to this, as it should have an effect on memory usage, so it is nice to have it in now (and also backported to 2.5).


Summary (updated)
-----------------

QIcon'ize KoRecentDocumentsPane, fetch big previews only on demand (save memory)


Description (updated)
-------

Real reason for this patch is that KFileItem::pixmap(...) is broken for items constructed with KFileItem(mode_t, mode_t, KUrl, bool) and no other mimetype related call before the one to ::pixmap. It will always return a pixmap with the "unknown" icon.
You can see this for files for which there is no preview created (for whatever reason).

But the patch fixes also the size mismatch between the fetched previews (200x200) and the usual ODF preview of 128x128 as well as that the preview just from the icon is set in size 128. And makes the code shorter.

Also load the big previews only on-demand, not by default. Could spare up to ~500 kB (10 files * (128*128 - 64*64) * 4 bytes) in theory, but I did not measure what the real effect is.

Also using KIcon instead of setting an own deep copy of the pixmap per each KoFileListItem should spare even more memory, due to KIcon reusing existing icon pixmaps.

Okay to backport to 2.5 as well?


Diffs (updated)
-----

  libs/main/KoDetailsPane.h 6da6133 
  libs/main/KoDetailsPane.cpp 8aa5965 
  libs/main/KoRecentDocumentsPane.h 98baeb8 
  libs/main/KoRecentDocumentsPane.cpp 521c7e6 
  libs/main/KoTemplatesPane.cpp cc76c05 

Diff: http://git.reviewboard.kde.org/r/105428/diff/


Testing (updated)
-------

Tried the recent template pane at least in Krita, Words, Sheets


Thanks,

Friedrich W. H. Kossebau

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20120705/0f0cc723/attachment.htm>


More information about the calligra-devel mailing list