chore: remove Singleton & replace getIApp with getApp (#5514)
This commit is contained in:
@@ -55,7 +55,7 @@ PluginsPage::PluginsPage()
|
||||
auto *description =
|
||||
new QLabel("You can load plugins by putting them into " +
|
||||
formatRichNamedLink(
|
||||
"file:///" + getIApp()->getPaths().pluginsDirectory,
|
||||
"file:///" + getApp()->getPaths().pluginsDirectory,
|
||||
"the Plugins directory") +
|
||||
". Each one is a new directory.");
|
||||
description->setOpenExternalLinks(true);
|
||||
@@ -95,7 +95,7 @@ void PluginsPage::rebuildContent()
|
||||
this->scrollAreaWidget_.append(this->dataFrame_);
|
||||
auto layout = frame.setLayoutType<QVBoxLayout>();
|
||||
layout->setParent(this->dataFrame_);
|
||||
for (const auto &[id, plugin] : getIApp()->getPlugins()->plugins())
|
||||
for (const auto &[id, plugin] : getApp()->getPlugins()->plugins())
|
||||
{
|
||||
auto groupHeaderText =
|
||||
QString("%1 (%2, from %3)")
|
||||
@@ -214,7 +214,7 @@ void PluginsPage::rebuildContent()
|
||||
val.push_back(name);
|
||||
}
|
||||
getSettings()->enabledPlugins.setValue(val);
|
||||
getIApp()->getPlugins()->reload(name);
|
||||
getApp()->getPlugins()->reload(name);
|
||||
this->rebuildContent();
|
||||
});
|
||||
pluginEntry->addRow(toggleButton);
|
||||
@@ -223,7 +223,7 @@ void PluginsPage::rebuildContent()
|
||||
auto *reloadButton = new QPushButton("Reload", this->dataFrame_);
|
||||
QObject::connect(reloadButton, &QPushButton::pressed,
|
||||
[name = id, this]() {
|
||||
getIApp()->getPlugins()->reload(name);
|
||||
getApp()->getPlugins()->reload(name);
|
||||
this->rebuildContent();
|
||||
});
|
||||
pluginEntry->addRow(reloadButton);
|
||||
|
||||
Reference in New Issue
Block a user