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:
@@ -233,7 +233,7 @@ void PluginController::load(const QFileInfo &index, const QDir &pluginDir,
|
||||
auto *temp = plugin.get();
|
||||
this->plugins_.insert({pluginName, std::move(plugin)});
|
||||
|
||||
if (getArgs().safeMode)
|
||||
if (getApp()->getArgs().safeMode)
|
||||
{
|
||||
// This isn't done earlier to ensure the user can disable a misbehaving plugin
|
||||
qCWarning(chatterinoLua) << "Skipping loading plugin " << meta.name
|
||||
|
||||
Reference in New Issue
Block a user