refactor: Make Args less of a singleton (#5041)

This means it's no longer a singleton, and its lifetime is bound to our application.
This felt like a good small experiment to see how its changes would look
if we did this.
As a shortcut, `getApp` that is already a mega singleton keeps a
reference to Args, this means places that are a bit more difficult to
inject into call `getApp()->getArgs()` just like other things are
accessed.
This commit is contained in:
pajlada
2023-12-29 15:40:31 +01:00
committed by GitHub
parent c65ebd26bd
commit d085ab578f
20 changed files with 78 additions and 69 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ PluginsPage::PluginsPage()
this->rebuildContent();
});
groupLayout->addRow(box);
if (getArgs().safeMode)
if (getApp()->getArgs().safeMode)
{
box->setEnabled(false);
auto *disabledLabel = new QLabel(this);
@@ -197,7 +197,7 @@ void PluginsPage::rebuildContent()
this->rebuildContent();
});
pluginEntry->addRow(reloadButton);
if (getArgs().safeMode)
if (getApp()->getArgs().safeMode)
{
reloadButton->setEnabled(false);
}