Bug 361034 - Use generic icon if no icon is specified
Summary: Use generic icon if no icon is specified
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 15.12.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-27 09:29 UTC by petrk
Modified: 2016-04-26 14:16 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 16.04.1


Attachments
Blank icons (69.49 KB, image/png)
2016-03-27 15:27 UTC, petrk
Details

Note You need to log in before you can comment on or make changes to this bug.
Description petrk 2016-03-27 09:29:43 UTC
If there's no icon specified them icon is invisible. Why not assign some sort of a generic icon in such case.

Reproducible: Always

Steps to Reproduce:
1. Find file without icon, .pdb for example
2. Admire blank icon
3. Enjoy OCD

Actual Results:  
Enjoy OCD. Blank icon looks weird and is off putting.

Expected Results:  
Enjoy generic icon, if someone wants to add custom icon someday, so be it.

Plasma 5.6 Breeze
Comment 1 andreas 2016-03-27 14:11:50 UTC
There is a default Icon when no mimetype Icon was found.
Comment 2 andreas 2016-03-27 14:12:22 UTC
There is a default Icon when no mimetype Icon was found.
Comment 3 petrk 2016-03-27 15:27:07 UTC
Created attachment 98113 [details]
Blank icons

If it's true then there's something wrong.
Comment 4 andreas 2016-03-27 19:02:49 UTC
Hi Emmanuel,

I'm not sure where this bug is related but it look like it is in dolphin. when I say right click -> create -> Text file and say a.pdb I get the same than in the bug report. when I say touch a.pdb I get the default unknown mimetype icon (http://imgur.com/C8lp8YB). In krusader I see the unknown icon.

Dolphin 15.12.3
KF 5.19.0
Qt 5.5.1
OS Manjaro
Comment 5 petrk 2016-03-28 12:59:37 UTC
I've tried with pcmanfm and it shows an icon.
Comment 6 Wolfgang Bauer 2016-04-06 09:42:23 UTC
I cannot reproduce this with .pdb files, but I see it with .sql.
And bug#358958 (which I can reproduce here) looks related too.

(In reply to Piotr Kloc from comment #5)
> I've tried with pcmanfm and it shows an icon.

Dolphin/KDE4 shows an icon too.
And KF5's open/save file dialog as well.
(both show the "unknown" icon for the same files where dolphin/KF5 shows no icon at all)

That's all with the same icon theme, and I see the same behaviour with both breeze and oxygen.

So this looks like a regression/problem in dolphin/KF5 to me...

Dolphin does show the "unknown" icon in the preview in the information side bar though.

(In reply to andreas from comment #4)
> when I say right click -> create -> Text file and say a.pdb I get the same
> than in the bug report. when I say touch a.pdb I get the default unknown
> mimetype icon

Well, the difference is the content of the file. Create New->Text file creates a (text) file with an empty line (i.e. it contains a line feed), while touch creates a completely empty file.
They are shown with a different filetype here, "text file" and "empty file" respectively.
Comment 7 Wolfgang Bauer 2016-04-22 19:39:54 UTC
I investigated this, and the problem happens if the mimetype specifies an icon name that cannot be loaded (e.g. because it doesn't exist). If the icon name is empty, dolphin does fall back to the generic "unknown" icon.

The reason for this "regression" apparently is different behaviour of QIcon::fromTheme() compared to KIcon that has been used in the KDE4 version: the default fallback icon of QIcon::fromTheme() is QIcon(), i.e. an empty one.

Specifying a different fallback icon to the call to QIcon::fromTheme() fixes it:
https://git.reviewboard.kde.org/r/127713/
Comment 8 Wolfgang Bauer 2016-04-22 19:40:10 UTC
*** Bug 358958 has been marked as a duplicate of this bug. ***
Comment 9 Wolfgang Bauer 2016-04-26 14:16:06 UTC
Git commit 44d4d2ea715719a08c639541530a5b330647297d by Wolfgang Bauer.
Committed on 26/04/2016 at 14:11.
Pushed by wbauer into branch 'Applications/16.04'.

Specify a fallback icon to QIcon::fromTheme()

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.
Related: bug 358958
FIXED-IN: 16.04.1
REVIEW: 127713

M  +2    -1    src/kitemviews/kstandarditemlistwidget.cpp

http://commits.kde.org/dolphin/44d4d2ea715719a08c639541530a5b330647297d