Skip to content

Commit

Permalink
Add author and description methods to IPluginList (#2118)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanFeenstra authored Sep 28, 2024
1 parent 9c130cb commit 7ed06a7
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/pluginlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void(const std::map<QString, PluginStates>&)>& func)
{
Expand Down
3 changes: 3 additions & 0 deletions src/pluginlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<void()>& callback);
boost::signals2::connection
onPluginMoved(const std::function<void(const QString&, int, int)>& func);
Expand Down
10 changes: 10 additions & 0 deletions src/pluginlistproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
3 changes: 3 additions & 0 deletions src/pluginlistproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7ed06a7

Please sign in to comment.