After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 525153 - Encrypted drive/media icons revert to fallback icon
Encrypted drive/media icons revert to fallback icon
Status: RESOLVED FIXED
Product: gvfs
Classification: Core
Component: computer backend
0.2.x
Other All
: Normal minor
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2008-03-30 17:57 UTC by Mike Auty
Modified: 2008-04-02 21:09 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Screenshot of missing icons for locked and unlocked encrypted volumes (121.07 KB, image/png)
2008-03-30 18:01 UTC, Mike Auty
  Details
Fallback patch (78.51 KB, patch)
2008-04-01 22:39 UTC, Christian Kellner
none Details | Review
Updated version, don't include garbage this time (1.74 KB, patch)
2008-04-01 22:42 UTC, Christian Kellner
none Details | Review
Also include a patch for GHalVolume. (3.57 KB, patch)
2008-04-01 23:10 UTC, Christian Kellner
none Details | Review
Another take (9.77 KB, patch)
2008-04-02 18:59 UTC, Christian Kellner
committed Details | Review

Description Mike Auty 2008-03-30 17:57:35 UTC
Please describe the problem:
Encrypted drives (I've only tested it with luks encrypted drives), show up in nautilus under computer, using the fallback-icon of a blank sheet with paper behind it.  This occurs with both locked and unlocked drives.  

Steps to reproduce:
1. Create an encrypted volume
2. Open the computer view in nautilus
3. 


Actual results:
Ugly fallback-icons appear (see following screenshot, which contains one locked and one unlocked encrypted drive).

Expected results:
Some vaguely drive/media shaped icons should appear, preferably indicating whether they're encrypted (or potentially an unlocked-encrypted drive/media).

Does this happen every time?
Both of my encrypted volumes show up this way, but I haven't extensively tested that it occurs on different machines, on USB/removable drives, etc.

Other information:
I was directed here by Rodney in bug 506532 comment 16, suggesting that this was due to an icon naming error, and related either to gvfs or glib/gio.  I'm happy to run any tests that may help or try out patches against the 2.22 tarballs, just let me know if I can help...  5:)
Comment 1 Mike Auty 2008-03-30 18:01:52 UTC
Created attachment 108271 [details]
Screenshot of missing icons for locked and unlocked encrypted volumes 

This screen shot shows a 20Gb encrypted volume, and a 60Gb encrypted and mounted volume, both are missing their icons, whilst the cd-rom drive and main filesystem do display the correct icons.
Comment 2 Sebastien Bacher 2008-03-31 10:45:19 UTC
the code uses media-encrypted which is not available in gnome-icon-theme
Comment 3 Lapo Calamandrei 2008-03-31 16:29:35 UTC
It should use a fallback when the icon is not available.
Comment 4 Christian Kellner 2008-04-01 22:39:43 UTC
Created attachment 108443 [details] [review]
Fallback patch

Ok, there has landed an intermediate fixup on stable which was to just remove the media-encrypted *at all*. I don't think that is too optimal, since some distros (e.g. fedora 9) already provide those icons. Also even if its not optimal that there are only two icons for encrypted drives so there is no distinction between encrypted media types (e.g. usb drives and hard drives) I think its better to give the user *some* feedback that a volume is encrypted, even though it might not be to correct media icon.
The attached patch makes to code fallback in case of encrypted media. I am going to apply that patch before 2.22.1 if after it got some testing (since I haven't done that, I only made sure it compiles).
Comment 5 Christian Kellner 2008-04-01 22:42:21 UTC
Created attachment 108444 [details] [review]
Updated version, don't include garbage this time
Comment 6 Christian Kellner 2008-04-01 23:10:19 UTC
Created attachment 108445 [details] [review]
Also include a patch for GHalVolume.

Forgot to also patch the GHalVolume. Sorry.
Comment 7 Mike Auty 2008-04-02 17:35:36 UTC
Hi Christian, thanks for creating the patch.  I had to modify it slightly to apply to 0.2.2 cleanly, (it was simply the lack of interim fix that caused the difference).  Unfortunately I'm still seeing the same thing as I was in my original screenshots (after a full reboot).  I'm happy to try out any other patches you may have, if it'll help solve the problem?
Comment 8 Christian Kellner 2008-04-02 17:45:17 UTC
Yeah, I am realized it here as well. The fallback is not good enough. Needs some code duplication from glib. I am on it. Thanks.
Comment 9 Christian Kellner 2008-04-02 18:59:40 UTC
Created attachment 108491 [details] [review]
Another take

This is getting old, really old, but I think that should fix it (eventually).
Comment 10 Christian Kellner 2008-04-02 19:35:47 UTC
Should be fixed with the following commit:

Add icon fallbacks for encrypted drives/media. (#525153)

        * hal/hal-utils.h:
        * hal/hal-utils.c:
        Create new files for utility functions and move get_disc_icon()
        and get_disc_name() here.
        Also create get_themed_icon_with_fallbacks() to create
        GThemedIcons with default fallbacks but with the ability to
        pass in another name to create the fallbacks from then the
        icon name.

        * hal/ghalmount.c:
        * hal/ghalvolume.c:
        Use newly created get_themed_icon_with_fallbacks () and pass
        in custom fallback name for encrypted mounts/volumes (#525153).

        * hal/Makefile.am:
        Add hal-utils.[hc]

        * programs/gvfs-mount.c:
        Display the icon names for mounts/volumes if the icon is
        a GThemedIcon.
Comment 11 Mike Auty 2008-04-02 21:01:55 UTC
Thanks, after a few headaches with git-diff (which doesn't seem to include new files) and git-diff --cached (which contains new files, but not modified ones), I finally got the patch sorted and tested, and it does indeed work!  Thanks for all your help Christian.  5:)
Comment 12 Christian Kellner 2008-04-02 21:09:37 UTC
Cool! Thanks for testing. Marking the patch as committed.