mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Clean up header generation code
This commit is contained in:
parent
1cd1822fcc
commit
0a9fa2fe09
1 changed files with 12 additions and 6 deletions
|
@ -70,14 +70,20 @@ void PluginsPage::rebuildContent()
|
||||||
auto layout = frame.setLayoutType<QVBoxLayout>();
|
auto layout = frame.setLayoutType<QVBoxLayout>();
|
||||||
for (const auto &[codename, plugin] : getApp()->plugins->plugins())
|
for (const auto &[codename, plugin] : getApp()->plugins->plugins())
|
||||||
{
|
{
|
||||||
auto headerText = QString("%1 (%2)").arg(
|
QString headerText;
|
||||||
plugin->meta.name,
|
|
||||||
QString::fromStdString(plugin->meta.version.to_string()));
|
|
||||||
if (plugin->isDupeName)
|
if (plugin->isDupeName)
|
||||||
{
|
{
|
||||||
// add ", from <folder name>)" in place of ")"
|
headerText = QString("%1 (%2, from %3)")
|
||||||
headerText.chop(1);
|
.arg(plugin->meta.name,
|
||||||
headerText += ", from " + codename + ")";
|
QString::fromStdString(
|
||||||
|
plugin->meta.version.to_string()),
|
||||||
|
codename);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
headerText = QString("%1 (%2)").arg(
|
||||||
|
plugin->meta.name,
|
||||||
|
QString::fromStdString(plugin->meta.version.to_string()));
|
||||||
}
|
}
|
||||||
auto plgroup = layout.emplace<QGroupBox>(headerText);
|
auto plgroup = layout.emplace<QGroupBox>(headerText);
|
||||||
auto pl = plgroup.setLayoutType<QFormLayout>();
|
auto pl = plgroup.setLayoutType<QFormLayout>();
|
||||||
|
|
Loading…
Reference in a new issue