Index: src/lib/plugin/kpluginmetadata.h =================================================================== --- src/lib/plugin/kpluginmetadata.h +++ src/lib/plugin/kpluginmetadata.h @@ -353,6 +353,15 @@ */ bool isEnabledByDefault() const; + /** + * @return the initial preference of the plugin. + * This is the preference to associate with this plugin initially (before + * the user has had any chance to define preferences for it). + * The bigger the value, the most preferred the service is. + * @since 5.67 + */ + int initialPreference() const; + /** * @return the value for @p key from the metadata or @p defaultValue if the key does not exist * or the value for @p key is not of type string Index: src/lib/plugin/kpluginmetadata.cpp =================================================================== --- src/lib/plugin/kpluginmetadata.cpp +++ src/lib/plugin/kpluginmetadata.cpp @@ -360,6 +360,11 @@ return false; } +int KPluginMetaData::initialPreference() const +{ + return rootObject()[QStringLiteral("InitialPreference")].toInt(); +} + QString KPluginMetaData::value(const QString &key, const QString &defaultValue) const { const QJsonValue value = m_metaData.value(key);