KIO: try to assign an icon to action submenus

David Faure faure at kde.org
Sun Mar 15 16:19:28 GMT 2020


On vendredi 13 mars 2020 21:19:42 CET Chloe Kudryavtsev wrote:
> 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).

If you're talking about KFileItemActionsPrivate::insertServicesSubmenus
that's a method of the Private class (as the classname indicates),
so you can change it as much as you want, it's not part of the public API.

> 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).

Right, but I don't like putting something in place with limitations, that 
someone else will surely have a problem with, one day.

> 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.

This seems a rather strong statement for the work at hand here.
If all that's needed is to pass an icon to insertServicesSubmenus you surely 
don't need to extend KConfig...

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5





More information about the Kde-frameworks-devel mailing list