From 5be2238eb129be9533e56da51fc50612b98188eb Mon Sep 17 00:00:00 2001 From: Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com> Date: Mon, 9 Sep 2024 17:07:48 +0200 Subject: [PATCH] Add author and description methods to IPluginList --- src/pluginlist.cpp | 20 ++++++++++++++++++++ src/pluginlist.h | 3 +++ src/pluginlistproxy.cpp | 10 ++++++++++ src/pluginlistproxy.h | 3 +++ 4 files changed, 36 insertions(+) diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 94aee98da..9a49b8281 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -1028,6 +1028,26 @@ bool PluginList::hasNoRecords(const QString& name) const } } +QString PluginList::author(const QString& name) const +{ + auto iter = m_ESPsByName.find(name); + if (iter == m_ESPsByName.end()) { + return QString(); + } else { + return m_ESPs[iter->second].author; + } +} + +QString PluginList::description(const QString& name) const +{ + auto iter = m_ESPsByName.find(name); + if (iter == m_ESPsByName.end()) { + return QString(); + } else { + return m_ESPs[iter->second].description; + } +} + boost::signals2::connection PluginList::onPluginStateChanged( const std::function&)>& func) { diff --git a/src/pluginlist.h b/src/pluginlist.h index 89c05141d..0588b4d78 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -244,6 +244,9 @@ class PluginList : public QAbstractItemModel bool isLightFlagged(const QString& name) const; bool hasNoRecords(const QString& name) const; + QString author(const QString& name) const; + QString description(const QString& name) const; + boost::signals2::connection onRefreshed(const std::function& callback); boost::signals2::connection onPluginMoved(const std::function& func); diff --git a/src/pluginlistproxy.cpp b/src/pluginlistproxy.cpp index 8b826a818..034a14290 100644 --- a/src/pluginlistproxy.cpp +++ b/src/pluginlistproxy.cpp @@ -128,3 +128,13 @@ bool PluginListProxy::hasNoRecords(const QString& name) const { return m_Proxied->hasNoRecords(name); } + +QString PluginListProxy::author(const QString& name) const +{ + return m_Proxied->author(name); +} + +QString PluginListProxy::description(const QString& name) const +{ + return m_Proxied->description(name); +} diff --git a/src/pluginlistproxy.h b/src/pluginlistproxy.h index 6865004a8..e289ced89 100644 --- a/src/pluginlistproxy.h +++ b/src/pluginlistproxy.h @@ -36,6 +36,9 @@ class PluginListProxy : public MOBase::IPluginList bool isLightFlagged(const QString& name) const override; bool hasNoRecords(const QString& name) const override; + QString author(const QString& name) const override; + QString description(const QString& name) const override; + private: friend class OrganizerProxy;