Review Request 127713: Specify the generic "unknown" icon as fallback to QIcon::fromTheme()
Wolfgang Bauer
wbauer at tmo.at
Fri Apr 22 21:30:31 BST 2016
> On April 22, 2016, 9:54 nachm., Emmanuel Pescosta wrote:
> > src/kitemviews/kstandarditemlistwidget.cpp, line 1448
> > <https://git.reviewboard.kde.org/r/127713/diff/1/?file=456479#file456479line1448>
> >
> > I don't know how expensive QIcon::fromTheme() is, but maybe we should store the unknown icon in a static variable? What do you think?
I don't think it's expensive as it should just get the icon from the icon cache apparently:
http://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/image/qicon.cpp#n1166
But yeah, why not?
I'll update the diff accordingly.
- Wolfgang
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/127713/#review94769
-----------------------------------------------------------
On April 22, 2016, 9:39 nachm., Wolfgang Bauer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127713/
> -----------------------------------------------------------
>
> (Updated April 22, 2016, 9:39 nachm.)
>
>
> Review request for Dolphin.
>
>
> Bugs: 358958 and 361034
> https://bugs.kde.org/show_bug.cgi?id=358958
> https://bugs.kde.org/show_bug.cgi?id=361034
>
>
> Repository: dolphin
>
>
> Description
> -------
>
> The default fallback of QIcon::fromTheme() is QIcon(), i.e. a null icon. Set the generic "unknown" icon as fallback to prevent missing icons for filetypes that specify an icon name that doesn't exist.
>
> This also gets rid of "QPixmap::scaled: Pixmap is a null pixmap" warnings in that case.
>
>
> Diffs
> -----
>
> src/kitemviews/kstandarditemlistwidget.cpp 66131d5
>
> Diff: https://git.reviewboard.kde.org/r/127713/diff/
>
>
> Testing
> -------
>
> Open a folder that contains files whose filetype specifies an nonexistent icon name (/dev/ contains a lot of those here).
> They show up using the generic "unknown" icon now, see attached screenshots.
>
>
> File Attachments
> ----------------
>
> without the patch
> https://git.reviewboard.kde.org/media/uploaded/files/2016/04/22/aec678ba-5769-4fc8-8632-6f5fba301652__before.png
> same folder with the patch
> https://git.reviewboard.kde.org/media/uploaded/files/2016/04/22/d2201425-a987-4611-812a-ae50ed24b32e__after.png
>
>
> Thanks,
>
> Wolfgang Bauer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20160422/e6944925/attachment.htm>
More information about the kfm-devel
mailing list