chore: remove Singleton & replace getIApp with getApp (#5514)

This commit is contained in:
pajlada
2024-07-21 15:09:59 +02:00
committed by GitHub
parent 21186df058
commit 5deec1f02f
145 changed files with 802 additions and 856 deletions
+4 -4
View File
@@ -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);