Commit 309ded7b authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Let plugin add additional status information

This can be used to communicate further status information, e.g. whether an external dependency or binary was found.

Differential Revision: https://phabricator.kde.org/D24191
parent 053561ef
......@@ -86,6 +86,11 @@ void AbstractBrowserPlugin::onSettingsChanged(const QJsonObject &newSettings)
Q_UNUSED(newSettings);
}
QJsonObject AbstractBrowserPlugin::status() const
{
return {};
}
QDebug AbstractBrowserPlugin::debug() const
{
auto d = qDebug();
......
......@@ -39,6 +39,13 @@ public:
// FIXME this should not be public but we need to change it from main.cpp
void setLoaded(bool loaded);
/**
* Lets the plugin add additional status information to the getSubsystemStatus request
*
* E.g. whether a library dependency or external binary is present.
*/
virtual QJsonObject status() const;
protected:
/*
* @arg subsystemId
......
......@@ -148,10 +148,10 @@ QJsonObject Settings::handleData(int serial, const QString &event, const QJsonOb
const QStringList subsystems = PluginManager::self().knownPluginSubsystems();
for (const QString &subsystem : subsystems) {
const AbstractBrowserPlugin *plugin = PluginManager::self().pluginForSubsystem(subsystem);
QJsonObject details{
{QStringLiteral("version"), plugin->protocolVersion()},
{QStringLiteral("loaded"), plugin->isLoaded()}
};
QJsonObject details = plugin->status();
details.insert(QStringLiteral("version"), plugin->protocolVersion());
details.insert(QStringLiteral("loaded"), plugin->isLoaded());
ret.insert(subsystem, details);
}
}
......
Markdown is supported
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