Return QStringList from getPluginInfo().

This commit is contained in:
Gerhard Hoffmann 2023-11-15 11:26:45 +01:00
parent 94b51b5794
commit 1a08f8ee3a
5 changed files with 14 additions and 17 deletions

View File

@ -5,7 +5,7 @@
* a simple class with only one method for plugin info * a simple class with only one method for plugin info
*/ */
#include <QObject> #include <QObject>
#include <QString> #include <QStringList>
class ATBAPPplugin class ATBAPPplugin
{ {
@ -14,7 +14,7 @@ public:
explicit ATBAPPplugin() = default; explicit ATBAPPplugin() = default;
virtual ~ATBAPPplugin() = default; virtual ~ATBAPPplugin() = default;
virtual const QString & getPluginInfo() = 0; virtual QStringList getPluginInfo() = 0;
}; };
Q_DECLARE_INTERFACE(ATBAPPplugin, Q_DECLARE_INTERFACE(ATBAPPplugin,

View File

@ -17,21 +17,18 @@ ATBVMCPlugin::ATBVMCPlugin(QObject *parent)
: VMCInterface(parent) : VMCInterface(parent)
, m_errorCode("") , m_errorCode("")
, m_errorDescription("") , m_errorDescription("")
, m_pluginInfo("")
, m_serialPortName("") , m_serialPortName("")
, m_useDebug(false) , m_useDebug(false)
, m_pluginState(PLUGIN_STATE::NOT_INITIALIZED) , m_pluginState(PLUGIN_STATE::NOT_INITIALIZED)
, m_vmc(nullptr) { , m_vmc(nullptr) {
QStringList lst; m_pluginInfo.clear();
lst << QString(" Interface: ") + INTERFACE; m_pluginInfo << QString(" Interface: ") + INTERFACE;
lst << QString("Interface Version: ") + INTERFACE_VERSION; m_pluginInfo << QString("Interface Version: ") + INTERFACE_VERSION;
lst << QString(" PluginName: ") + PLUGIN_NAME; m_pluginInfo << QString(" PluginName: ") + PLUGIN_NAME;
lst << QString(" Version: ") + PLUGIN_VERSION; m_pluginInfo << QString(" Version: ") + PLUGIN_VERSION;
lst << QString(" git-describe: ") + PLUGIN_GIT_DESCRIBE; m_pluginInfo << QString(" git-describe: ") + PLUGIN_GIT_DESCRIBE;
lst << QString(" Extended version: ") + PLUGIN_EXTENDED_VERSION; m_pluginInfo << QString(" Extended version: ") + PLUGIN_EXTENDED_VERSION;
m_pluginInfo = lst.join('\n');
} }
ATBVMCPlugin::~ATBVMCPlugin() { ATBVMCPlugin::~ATBVMCPlugin() {
@ -41,7 +38,7 @@ ATBVMCPlugin::~ATBVMCPlugin() {
} }
} }
QString const &ATBVMCPlugin::getPluginInfo() { QStringList ATBVMCPlugin::getPluginInfo() {
return m_pluginInfo; return m_pluginInfo;
} }

View File

@ -24,7 +24,7 @@ public:
explicit ATBVMCPlugin(QObject *parent = nullptr); explicit ATBVMCPlugin(QObject *parent = nullptr);
virtual ~ATBVMCPlugin(); virtual ~ATBVMCPlugin();
virtual const QString & getPluginInfo() override; virtual QStringList getPluginInfo() override;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// interface: // interface:
@ -59,7 +59,7 @@ public slots:
private: private:
QString m_errorCode; QString m_errorCode;
QString m_errorDescription; QString m_errorDescription;
QString m_pluginInfo; QStringList m_pluginInfo;
QString m_serialPortName; QString m_serialPortName;
bool m_useDebug; bool m_useDebug;
PLUGIN_STATE m_pluginState; PLUGIN_STATE m_pluginState;

View File

@ -45,7 +45,7 @@ public:
explicit UnifiedDCVMCInterface() = default; explicit UnifiedDCVMCInterface() = default;
virtual ~UnifiedDCVMCInterface() = default; virtual ~UnifiedDCVMCInterface() = default;
virtual const QString & getPluginInfo() = 0; virtual QStringList getPluginInfo() = 0;
// mandantory ATBAPP plugin methods: // mandantory ATBAPP plugin methods:
virtual PLUGIN_STATE getState() = 0; virtual PLUGIN_STATE getState() = 0;

View File

@ -27,7 +27,7 @@ public:
explicit VMCInterface(QObject *parent = nullptr) : QObject(parent) {} explicit VMCInterface(QObject *parent = nullptr) : QObject(parent) {}
virtual ~VMCInterface() = default; virtual ~VMCInterface() = default;
virtual const QString & getPluginInfo() = 0; virtual QStringList getPluginInfo() = 0;
virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QObject *atbSystem, virtual PLUGIN_STATE initPlugin(QObject *eventReceiver, QObject *atbSystem,
QObject *hmiConfig, QSettings const &settings) override { QObject *hmiConfig, QSettings const &settings) override {