mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 20:40:29 +08:00
Ref T107, some minor fixes while investigating T107
This commit is contained in:
committed by
Mathew Sutcliffe
parent
880cedec5d
commit
0e3a06c24e
@@ -103,7 +103,7 @@ namespace BlackCore
|
|||||||
const QJsonObject json = loader.metaData();
|
const QJsonObject json = loader.metaData();
|
||||||
if (!isValid(json))
|
if (!isValid(json))
|
||||||
{
|
{
|
||||||
CLogMessage(this).warning("Plugin %1 invalid, not loading it") << path;
|
CLogMessage(this).warning("Plugin '%1' invalid, not loading it") << path;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -93,4 +93,4 @@ namespace BlackCore
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BLACKCORE_PLUGIN_MANAGER_H
|
#endif // guard
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace BlackCore
|
|||||||
const CSequence<QJsonObject> &plugins = getPlugins();
|
const CSequence<QJsonObject> &plugins = getPlugins();
|
||||||
for (const QJsonObject &json : plugins)
|
for (const QJsonObject &json : plugins)
|
||||||
{
|
{
|
||||||
QString iid = json["IID"].toString();
|
const QString iid = json["IID"].toString();
|
||||||
if (iid == QStringLiteral("org.swift-project.blackcore.simulatorinterface"))
|
if (iid == QStringLiteral("org.swift-project.blackcore.simulatorinterface"))
|
||||||
{
|
{
|
||||||
auto it = m_plugins.insert(pluginIdentifier(json), {});
|
auto it = m_plugins.insert(pluginIdentifier(json), {});
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackgui/pluginselector.h"
|
#include "blackgui/pluginselector.h"
|
||||||
|
#include "blackmisc/verify.h"
|
||||||
|
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
@@ -36,6 +37,10 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CPluginSelector::addPlugin(const QString &identifier, const QString &name, bool hasConfig, bool enabled)
|
void CPluginSelector::addPlugin(const QString &identifier, const QString &name, bool hasConfig, bool enabled)
|
||||||
{
|
{
|
||||||
|
// skip if identifier is missing, which should normally not happen
|
||||||
|
BLACK_VERIFY_X(!identifier.isEmpty(), Q_FUNC_INFO, "Missing identifier");
|
||||||
|
if (identifier.isEmpty()) { return; }
|
||||||
|
|
||||||
QWidget *pw = new QWidget;
|
QWidget *pw = new QWidget;
|
||||||
QHBoxLayout *layout = new QHBoxLayout;
|
QHBoxLayout *layout = new QHBoxLayout;
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ namespace BlackMisc
|
|||||||
if (! json.contains("MetaData")) { throw CJsonException("Missing 'MetaData'"); }
|
if (! json.contains("MetaData")) { throw CJsonException("Missing 'MetaData'"); }
|
||||||
|
|
||||||
// json data is already validated by CPluginManagerSimulator
|
// json data is already validated by CPluginManagerSimulator
|
||||||
CJsonScope scope("MetaData");
|
//! \todo for RW See T107, remove, change code?
|
||||||
|
// CJsonScope scope("MetaData");
|
||||||
CValueObject::convertFromJson(json["MetaData"].toObject());
|
CValueObject::convertFromJson(json["MetaData"].toObject());
|
||||||
m_valid = true;
|
m_valid = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ namespace BlackSimPlugin
|
|||||||
/*!
|
/*!
|
||||||
* Window for setting up the FSX plugin.
|
* Window for setting up the FSX plugin.
|
||||||
*/
|
*/
|
||||||
class CSimulatorFsxConfig : public QObject, public BlackGui::IPluginConfig
|
class CSimulatorFsxConfig : public QObject, public BlackGui::IPluginConfig
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PLUGIN_METADATA(IID "org.swift-project.blackgui.pluginconfiginterface" FILE "simulatorfsxconfig.json")
|
Q_PLUGIN_METADATA(IID "org.swift-project.blackgui.pluginconfiginterface" FILE "simulatorfsxconfig.json")
|
||||||
|
|||||||
Reference in New Issue
Block a user