From: Alexander Lohnau Date: Wed, 15 Feb 2023 06:45:11 +0000 (+0100) Subject: Allow empty metadata for KOverlayIconPlugin X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/54f62d22b06dc54979cc1a6e26ba881df5cc6ef1 Allow empty metadata for KOverlayIconPlugin We do not read the metadata anywhere, consequently we can allow empty metadata. Consumers now don't have to provide a file and we do no spend time parsing the JSON. Task: https://phabricator.kde.org/T14538 --- diff --git a/src/kitemviews/kfileitemmodelrolesupdater.cpp b/src/kitemviews/kfileitemmodelrolesupdater.cpp index 4fd126619..1a849dcd5 100644 --- a/src/kitemviews/kfileitemmodelrolesupdater.cpp +++ b/src/kitemviews/kfileitemmodelrolesupdater.cpp @@ -118,7 +118,8 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel *model, QO m_directoryContentsCounter = new KDirectoryContentsCounter(m_model, this); connect(m_directoryContentsCounter, &KDirectoryContentsCounter::result, this, &KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived); - const auto plugins = KPluginMetaData::findPlugins(QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR)) + QStringLiteral("/overlayicon")); + const QString pluginNamespace = QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR)) + QStringLiteral("/overlayicon"); + const auto plugins = KPluginMetaData::findPlugins(pluginNamespace, {}, KPluginMetaData::AllowEmptyMetaData); for (const KPluginMetaData &data : plugins) { auto instance = QPluginLoader(data.fileName()).instance(); auto plugin = qobject_cast(instance);