Commit 6ba01a55 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

kcminit: Allow running modules by their name

Alternatively we require to pass an absolute path which is more
cumbersome than one would want.
parent 1ed50d01
......@@ -101,9 +101,19 @@ KCMInit::KCMInit(const QCommandLineParser &args)
return;
}
if (!arg.isEmpty()) {
if (KPluginMetaData data(arg); data.isValid()) {
m_list << arg;
const auto positionalArguments = args.positionalArguments();
if (!positionalArguments.isEmpty()) {
for (const auto &arg : positionalArguments) {
KPluginMetaData data(arg);
if (!data.isValid()) {
data = KPluginMetaData::findPluginById(QStringLiteral("plasma/kcminit"), arg);
}
if (data.isValid()) {
m_list << data.fileName();
} else {
qWarning() << "Could not find" << arg;
}
}
} else {
m_list = KPluginMetaData::findPlugins(QStringLiteral("plasma/kcminit"));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment