diff --git a/src/lib/plugin/kpluginmetadata.h b/src/lib/plugin/kpluginmetadata.h --- a/src/lib/plugin/kpluginmetadata.h +++ b/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). + * Higher values indicate stronger preference. + * @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 diff --git a/src/lib/plugin/kpluginmetadata.cpp b/src/lib/plugin/kpluginmetadata.cpp --- a/src/lib/plugin/kpluginmetadata.cpp +++ b/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);