KPluginMetaData: add initialPreference() getter
ClosedPublic

Authored by dfaure on Jan 5 2020, 8:09 PM.

Details

Summary

useful to sort parts by preference.

auto byInitialPreference = [](const KPluginMetaData &left, const KPluginMetaData &right) { return left.initialPreference() > right.initialPreference(); };
std::sort(plugins.begin(), plugins.end(), byInitialPreference);
Test Plan

gvpart.so now comes first among all parts that can handle a jpeg file

Diff Detail

Repository
R244 KCoreAddons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
dfaure requested review of this revision.Jan 5 2020, 8:09 PM
dfaure created this revision.
arichardson accepted this revision.Jan 5 2020, 9:07 PM
This revision is now accepted and ready to land.Jan 5 2020, 9:07 PM
arichardson added inline comments.Jan 5 2020, 9:08 PM
src/lib/plugin/kpluginmetadata.h
362

Minor grammar suggestion:

This is the preference associated with this plugin initially (before the user has had any chance to define preferences for it). Higher values indicate stronger preference.

dfaure updated this revision to Diff 72838.Jan 5 2020, 10:45 PM

improve docu

arichardson accepted this revision.Jan 5 2020, 11:54 PM
This revision was automatically updated to reflect the committed changes.
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 6 2020, 11:25 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript