KIO: try to assign an icon to action submenus

David Faure faure at kde.org
Sat Mar 21 11:56:30 GMT 2020


On dimanche 15 mars 2020 19:11:39 CET Chloe Kudryavtsev wrote:
> So we need to be able to pass an icon inside of a ServiceList.
> As mentioned, ServiceList is a QList<KServiceAction>.
> QList is part of Qt and KServiceAction is part of KService.

The usual solution for this is to replace ServiceList with 
struct SubMenu
{
    QList<KServiceAction> actions;
    QIcon icon;
};
in the code that is about a submenu, like in insertServicesSubmenus.

But I see what you mean, submenus are an aggregation of independent actions 
who belong to the same priority (as selected by selectList()), so there's no 
single definition for those submenus, where we would be able to set an icon.

C++ problems can be fixed, but not conceptual ones like the one above.
I'm dropping my objections.
https://phabricator.kde.org/D27950 approved.

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





More information about the Kde-frameworks-devel mailing list