← Back to team overview

dx-packages team mailing list archive

[Bug 1582433] Re: Dash does not handle .desktop files correctly if there are hyphens in the directory path

 

Thanks for your work on this, but I'm not sure it is fixed 100% yet. For
example:

$ cat ~/.local/share/applications/wine/Programs/GOG.com/Might\ and\ Magic\ 4-5/Might\ and\ Magic\ 4-5\ -\ World\ of\ Xeen\ \(Full\ Speech\).desktop 
[Desktop Entry]
Name=Might and Magic 4-5 - World of Xeen (Full Speech)
Exec=env WINEPREFIX="/home/neil/games/mm45/wine" wine C:\\\\windows\\\\command\\\\start.exe /Unix /home/neil/games/mm45/wine/dosdevices/c:/users/Public/Start\\ Menu/Programs/GOG.com/Might\\ and\\ Magic\\ 4-5/Might\\ and\\ Magic\\ 4-5\\ -\\ World\\ of\\ Xeen\\ \\(Full\\ Speech\\).lnk
Type=Application
StartupNotify=true
Path=/home/neil/games/mm45/wine/dosdevices/c:/GOG Games/Might and Magic 4-5/DOSBOX
Icon=C399_goggame-1207661233.0

$ ag -g C399_goggame-1207 ~/.local/share/
/home/neil/.local/share/icons/hicolor/48x48/apps/C399_goggame-1207661233.0.png
/home/neil/.local/share/icons/hicolor/256x256/apps/C399_goggame-1207661233.0.png
/home/neil/.local/share/icons/hicolor/16x16/apps/C399_goggame-1207661233.0.png
/home/neil/.local/share/icons/hicolor/32x32/apps/C399_goggame-1207661233.0.png

But the correct icon does not show. Instead, I get the generic "toolbox"
icon as per screenshot attached. Oddly enough, my testcase in the
original posting does display the correct icon. Perhaps this is because
I specify the full path?

** Attachment added: "generic_icon.png"
   https://bugs.launchpad.net/ubuntu/+source/unity-lens-applications/+bug/1582433/+attachment/4700416/+files/generic_icon.png

-- 
You received this bug notification because you are a member of DX
Packages, which is subscribed to unity-lens-applications in Ubuntu.
https://bugs.launchpad.net/bugs/1582433

Title:
  Dash does not handle .desktop files correctly if there are hyphens in
  the directory path

Status in unity-lens-applications package in Ubuntu:
  Fix Released
Status in unity-lens-applications source package in Xenial:
  Fix Committed

Bug description:
  [Impact]

  The Unity dash can fail to display the icon or title from a .desktop
  file correctly if it resides under a directory containing a hyphen
  character.

  [Test case]

  As an example (on my 16.04 machine):

  $ cat << EOF > test.desktop
  [Desktop Entry]
  Name=Hyphen test
  Exec=/bin/true
  Type=Application
  Icon=/usr/share/icons/suru/apps/256/dash.png
  EOF

  $ chmod +x test.desktop
  $ mkdir ~/.local/share/applications/hyphen-test
  $ mv test.desktop ~/.local/share/applications/hyphen-test/

  Now, open the dash and search for "hyphen". On my machine, I see the
  correct icon but no title is displayed underneath.

  $ mv ~/.local/share/applications/hyphen-test
  ~/.local/share/applications/hyphen

  Searching for "hyphen" in the dash now shows an entry with the correct
  icon and title (but also still shows the defunct previous entry
  without title).

  The effect of the hyphenated path seems variable. Some apps show the
  wrong icon, some have a missing title, some have both errors.

  The problem only seems to be with hyphens in the directories. Hyphens
  in the file itself are fine. See the screenshot - Might and Magic 4&5
  has had a desktop file installed under a subdirectory with a hyphen,
  whereas Heroes of Might and Magic has a desktop file in the root
  directory but contains a hyphen in the filename. The latter is shown
  correctly, but the desktop files in the former directory are not shown
  properly.

  [Possible Regressions]
  Nothing known.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/unity-lens-applications/+bug/1582433/+subscriptions