Review Request 117850: Use QPixmap for loading images

Martin Klapetek martin.klapetek at gmail.com
Tue Apr 29 10:55:32 UTC 2014



> On April 28, 2014, 10:52 p.m., Martin Klapetek wrote:
> > src/personsmodel.cpp, line 113
> > <https://git.reviewboard.kde.org/r/117850/diff/1/?file=269059#file269059line113>
> >
> >     Note that KABC::Adressee actually uses QImage for person.photo() --> now the question is - is this image always loaded when person.photo() is called? Otherwise the always-cached-QPixmap would save only so much...
> >     
> >     I'm also wondering why the PIM people chose QImage over the implicitly cached QPixmap
> 
> David Edmundson wrote:
>     For the Person.photo().data() case, they're not loading from a file, they're loading it from a QByteArray inside the VCard. This QImage is kept inside the Addresee, so it will only ever be loaded once, after that we're implicitly sharing it as per normal.
>     
>       194 QImage Picture::data() const
>       195 {
>       196   if ( d->mData.isNull() && !d->mRawData.isEmpty() ) {
>       197     d->mData.loadFromData( d->mRawData );
>       198   }
>       199 
>       200   return d->mData;
>       201 }
> 
> Martin Klapetek wrote:
>     So what does the url() then point to (if the image data is part of the vcard)?
> 
> David Edmundson wrote:
>     A vcard will have either: 
>      - data
>      - a URL
>

Oh right, that's why there's that if in the code


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117850/#review56798
-----------------------------------------------------------


On April 28, 2014, 10:48 p.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117850/
> -----------------------------------------------------------
> 
> (Updated April 28, 2014, 10:48 p.m.)
> 
> 
> Review request for Telepathy.
> 
> 
> Repository: libkpeople
> 
> 
> Description
> -------
> 
> Use QPixmap for loading images
> 
> QPixmap has an implit cache when loading from a path. QImage does not.
> This saves a lot of QImage::load calls.
> 
> As it goes via QVariant .toImage and .toPixmap work the same as before.
> ktp-contactlist used pixmap anyway.
> 
> 
> Diffs
> -----
> 
>   src/personsmodel.cpp 9575d46 
> 
> Diff: https://git.reviewboard.kde.org/r/117850/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David Edmundson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20140429/26ae4e33/attachment.html>


More information about the KDE-Telepathy mailing list