diff --git a/src/kpluginselector.h b/src/kpluginselector.h --- a/src/kpluginselector.h +++ b/src/kpluginselector.h @@ -209,6 +209,25 @@ */ QStringList configurationArguments() const; + /** + * Appends the service filename to the list of configuration arguments. + * If you set this option to true the QVariantList passed to the KCMs + * will start with the configuration arguments, then the service filename + * and then the QVariantMap of the plugin metadata + * + * @see setConfigurationArguments + * + * @since 5.71 + */ + void setAppendServiceFile(bool append); + + /** + * Returns true if the service filename will be appended to the configuration arguments + * + * @since 5.71 + */ + bool isAppendServiceFile() const; + /** * Shows the configuration dialog for the plugin @p pluginId if it's available * diff --git a/src/kpluginselector.cpp b/src/kpluginselector.cpp --- a/src/kpluginselector.cpp +++ b/src/kpluginselector.cpp @@ -57,6 +57,7 @@ , listView(nullptr) , categoryDrawer(nullptr) , showIcons(false) + , appendServiceFileToArguments(false) { } @@ -422,6 +423,16 @@ return d->kcmArguments; } +void KPluginSelector::setAppendServiceFile(bool append) +{ + d->appendServiceFileToArguments = append; +} + +bool KPluginSelector::isAppendServiceFile() const +{ + return d->appendServiceFileToArguments; +} + void KPluginSelector::showConfiguration(const QString& componentName) { QModelIndex idx; @@ -837,7 +848,11 @@ for (const KService::Ptr &servicePtr : lstServices) { if (!servicePtr->noDisplay()) { KCModuleInfo moduleInfo(servicePtr); - KCModuleProxy *currentModuleProxy = new KCModuleProxy(moduleInfo, moduleProxyParentWidget, pluginSelector_d->kcmArguments); + QStringList arguments = pluginSelector_d->kcmArguments; + if (pluginSelector_d->appendServiceFileToArguments) { + arguments.append(moduleInfo.fileName()); + } + KCModuleProxy *currentModuleProxy = new KCModuleProxy(moduleInfo, moduleProxyParentWidget, arguments); if (currentModuleProxy->realModule()) { moduleProxyList << currentModuleProxy; if (mainWidget && !newTabWidget) { diff --git a/src/kpluginselector_p.h b/src/kpluginselector_p.h --- a/src/kpluginselector_p.h +++ b/src/kpluginselector_p.h @@ -81,6 +81,7 @@ DependenciesWidget *dependenciesWidget; bool showIcons; QStringList kcmArguments; + bool appendServiceFileToArguments; }; class PluginEntry