On 3/13/20 2:18 PM, David Faure wrote:
> On mardi 3 mars 2020 18:29:47 CET Chloe Kudryavtsev wrote:
>> Currently, action submenus (X-KDE-Submenu) have no icons.
>> This patch makes it inherit the icon of the first action.
> 
> I wonder if this is always wanted? The icon for the first action might not be 
> representative of what the other actions do.
> 
> Wouldn't it be better to be able to explicitly specify the icon for the 
> submenu?
> 

That would be better, but that can't easily be done without reorganizing
how the whole thing works.
insertServicesSubmenus() currently receives a QMap<QString,
ServiceList>, the target QMenu and a boolean.
Meanwhile, the icon for the desktop file as a whole would be available
in the KConfigGroup (from desktopFile).

Basically, making the "global" (i.e [Desktop Entry]) Icon setting be
what is used would require breaking API (changing the signature of
insertServicesSubmenus).
In the meanwhile, in practice, ServiceMenus do have (at the very least)
similar icons, because TryExec is effectively global (there is no
support for disabling individual actions, it's done purely on a
per-desktop-file basis).
Ideally, of course, everything would be explicit, but the amount of
changes quickly grows if one wants to do this right.

I would participate in an effort to extend KConfig, KIO and co. to
improve the overall handling of .desktop files, but the process in
general is kind of a bother, and I don't really like touching C++
nowadays either, so it's a hard sell to put that as a high priority for me.
-

Attachment: 0xEB24BAD412DE2823.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to