Bug 356548 - *.desktop files, moved from FolderView widget, has incorrect icons
Summary: *.desktop files, moved from FolderView widget, has incorrect icons
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Desktop icons & Folder View widget (show other bugs)
Version: 5.5.0
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
: 360258 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-12 11:17 UTC by opensuse.lietuviu.kalba
Modified: 2016-03-09 19:02 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Video (2.16 MB, video/webm)
2015-12-12 11:17 UTC, opensuse.lietuviu.kalba
Details

Note You need to log in before you can comment on or make changes to this bug.
Description opensuse.lietuviu.kalba 2015-12-12 11:17:21 UTC
Moving icons (programs) from Folder container produces incorrect icons for programs.

Reproducible: Always

Steps to Reproduce:
1. Configure to show desktop Folder container in Desktop
2. Move icon (program) to new panel or to desktop

Actual Results:  
I see * icon

Expected Results:  
I see same icon, as in Folder container
Comment 1 opensuse.lietuviu.kalba 2015-12-12 11:17:55 UTC
Created attachment 96007 [details]
Video
Comment 2 David Edmundson 2015-12-13 17:41:50 UTC
thanks
Comment 3 Kai Uwe Broulik 2016-03-07 17:25:29 UTC
When I open desktop:/ from Dolphin it works, so it might be FolderView doing something wrong/differently here?
Comment 4 Eike Hein 2016-03-07 18:24:53 UTC
Do you mean live at runtime? It works fine in FV too if you reload or restart.
Comment 5 Kai Uwe Broulik 2016-03-07 18:37:52 UTC
Live when the applet is created. Works both ways with Dolphin.
Comment 6 Eike Hein 2016-03-07 18:41:15 UTC
I'll take closer look tomorrow, thx
Comment 7 Kai Uwe Broulik 2016-03-08 16:56:20 UTC
*** Bug 360258 has been marked as a duplicate of this bug. ***
Comment 8 Eike Hein 2016-03-09 10:30:59 UTC
Git commit 98de56e5ef14959d8e2bdc07bd69396e06a37e31 by Eike Hein.
Committed on 09/03/2016 at 10:30.
Pushed by hein into branch 'master'.

Watch for and notify about XDG_DESKTOP_DIR changes.

Will make KIO clients listing desktop:/ re-list at runtime. Makes
the desktop not break when changing the desktop location in the
user paths KCM.

M  +23   -0    kioslave/desktop/desktopnotifier.cpp
M  +4    -0    kioslave/desktop/desktopnotifier.h

http://commits.kde.org/plasma-workspace/98de56e5ef14959d8e2bdc07bd69396e06a37e31
Comment 9 Eike Hein 2016-03-09 18:02:04 UTC
Git commit 7a54ad3dafc5cb689168b6d3dc00477e30f32d9b by Eike Hein.
Committed on 09/03/2016 at 18:01.
Pushed by hein into branch 'master'.

Handle KIO URLs which proxy for local URLs in Icon applet.

Dragging an app link .desktop file from Folder View showing desktop:/
from Folder View (but not Dolphin) to desktop/panel, spawning an Icon,
was broken because:
- KDirModel::metaData adds the UDS_LOCAL_PATH (local file) url as
  text/uri-list to the drag MIME data, but also the original desktop:/
  URL as a second special MIME format for KDE URLs, using KUrlMimeData
- Dolphin only does the first part, using a partial code copy from
  KDirModel
- ContainmentInterface::processMimeData uses KUrlMimeData with default
  options to decode the drag MIME data - the default option is
  PreferKdeURLs, so it retrieves the desktop:/ URL from the FV drag
  but not the Dolphin drag (since it lacks it)
- Thus the Icon applet is handed a desktop:/ URL in the FV case, which
  the code - not using KIO - isn't written to handle

This patch adds an async KIO::StatJob to the Icon code when
QURL::isLocalFile is fast to try and resolve an URL to a more local
one the rest of the code can handle.

Rewriting more of the Icon code to use KIO /would/ have been nice,
however it ultimately ends up using KDesktopFile which can't handle
non-local files, so at some point resolving to the proxied-for path
would happen anyway.

M  +18   -0    applets/icon/plugin/icon_p.cpp
M  +2    -0    applets/icon/plugin/icon_p.h

http://commits.kde.org/plasma-workspace/7a54ad3dafc5cb689168b6d3dc00477e30f32d9b
Comment 10 opensuse.lietuviu.kalba 2016-03-09 18:47:37 UTC
This patch will afect KDE Plasma 5.6?
Comment 11 Eike Hein 2016-03-09 19:01:14 UTC
Git commit 48f260df95dfb0115d44ab73d0731119bea901e9 by Eike Hein.
Committed on 09/03/2016 at 19:00.
Pushed by hein into branch 'Plasma/5.6'.

Watch for and notify about XDG_DESKTOP_DIR changes.

Will make KIO clients listing desktop:/ re-list at runtime. Makes
the desktop not break when changing the desktop location in the
user paths KCM.

M  +23   -0    kioslave/desktop/desktopnotifier.cpp
M  +4    -0    kioslave/desktop/desktopnotifier.h

http://commits.kde.org/plasma-workspace/48f260df95dfb0115d44ab73d0731119bea901e9
Comment 12 Eike Hein 2016-03-09 19:01:14 UTC
Git commit 7d60594111ebc075bbd60d3e8d1fcdcdb0f3c139 by Eike Hein.
Committed on 09/03/2016 at 19:01.
Pushed by hein into branch 'Plasma/5.6'.

Handle KIO URLs which proxy for local URLs in Icon applet.

Dragging an app link .desktop file from Folder View showing desktop:/
from Folder View (but not Dolphin) to desktop/panel, spawning an Icon,
was broken because:
- KDirModel::metaData adds the UDS_LOCAL_PATH (local file) url as
  text/uri-list to the drag MIME data, but also the original desktop:/
  URL as a second special MIME format for KDE URLs, using KUrlMimeData
- Dolphin only does the first part, using a partial code copy from
  KDirModel
- ContainmentInterface::processMimeData uses KUrlMimeData with default
  options to decode the drag MIME data - the default option is
  PreferKdeURLs, so it retrieves the desktop:/ URL from the FV drag
  but not the Dolphin drag (since it lacks it)
- Thus the Icon applet is handed a desktop:/ URL in the FV case, which
  the code - not using KIO - isn't written to handle

This patch adds an async KIO::StatJob to the Icon code when
QURL::isLocalFile is fast to try and resolve an URL to a more local
one the rest of the code can handle.

Rewriting more of the Icon code to use KIO /would/ have been nice,
however it ultimately ends up using KDesktopFile which can't handle
non-local files, so at some point resolving to the proxied-for path
would happen anyway.

M  +18   -0    applets/icon/plugin/icon_p.cpp
M  +2    -0    applets/icon/plugin/icon_p.h

http://commits.kde.org/plasma-workspace/7d60594111ebc075bbd60d3e8d1fcdcdb0f3c139
Comment 13 Eike Hein 2016-03-09 19:02:37 UTC
> This patch will afect KDE Plasma 5.6?

Yes.