Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add author and description methods to IPluginList #2118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading