Commit 93e20edf authored by Alexander Lohnau's avatar Alexander Lohnau 💬 Committed by Luigi Toscano
Browse files

powerdevilactionpool: Avoid double quering of plugin namespace

parent 623f98bb
......@@ -99,15 +99,10 @@ void ActionPool::init(PowerDevil::Core *parent)
}
// Register DBus objects
{
QVector<KPluginMetaData> offers = KPluginMetaData::findPlugins(QStringLiteral("powerdevil/action"), [](const KPluginMetaData &data) {
return data.value(QStringLiteral("X-KDE-PowerDevil-Action-RegistersDBusInterface"), false);
});
for (const KPluginMetaData &offer : offers) {
QString actionId = offer.value(QStringLiteral("X-KDE-PowerDevil-Action-ID"));
if (m_actionPool.contains(actionId)) {
QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/kde/Solid/PowerManagement/Actions/") + actionId, m_actionPool[actionId]);
}
for (const KPluginMetaData &offer : offers) {
QString actionId = offer.value(QStringLiteral("X-KDE-PowerDevil-Action-ID"));
if (offer.value(QStringLiteral("X-KDE-PowerDevil-Action-RegistersDBusInterface"), false) && m_actionPool.contains(actionId)) {
QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/kde/Solid/PowerManagement/Actions/") + actionId, m_actionPool[actionId]);
}
}
}
......
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