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
+7 -7
View File
@@ -65,7 +65,7 @@ namespace chatterino::lua::api {
int c2_register_command(lua_State *L)
{
auto *pl = getIApp()->getPlugins()->getPluginByStatePtr(L);
auto *pl = getApp()->getPlugins()->getPluginByStatePtr(L);
if (pl == nullptr)
{
luaL_error(L, "internal error: no plugin");
@@ -99,7 +99,7 @@ int c2_register_command(lua_State *L)
int c2_register_callback(lua_State *L)
{
auto *pl = getIApp()->getPlugins()->getPluginByStatePtr(L);
auto *pl = getApp()->getPlugins()->getPluginByStatePtr(L);
if (pl == nullptr)
{
luaL_error(L, "internal error: no plugin");
@@ -133,7 +133,7 @@ int c2_register_callback(lua_State *L)
int c2_log(lua_State *L)
{
auto *pl = getIApp()->getPlugins()->getPluginByStatePtr(L);
auto *pl = getApp()->getPlugins()->getPluginByStatePtr(L);
if (pl == nullptr)
{
luaL_error(L, "c2_log: internal error: no plugin?");
@@ -154,7 +154,7 @@ int c2_log(lua_State *L)
int c2_later(lua_State *L)
{
auto *pl = getIApp()->getPlugins()->getPluginByStatePtr(L);
auto *pl = getApp()->getPlugins()->getPluginByStatePtr(L);
if (pl == nullptr)
{
return luaL_error(L, "c2.later: internal error: no plugin?");
@@ -257,7 +257,7 @@ int g_load(lua_State *L)
int loadfile(lua_State *L, const QString &str)
{
auto *pl = getIApp()->getPlugins()->getPluginByStatePtr(L);
auto *pl = getApp()->getPlugins()->getPluginByStatePtr(L);
if (pl == nullptr)
{
return luaL_error(L, "loadfile: internal error: no plugin?");
@@ -307,7 +307,7 @@ int searcherAbsolute(lua_State *L)
name = name.replace('.', QDir::separator());
QString filename;
auto *pl = getIApp()->getPlugins()->getPluginByStatePtr(L);
auto *pl = getApp()->getPlugins()->getPluginByStatePtr(L);
if (pl == nullptr)
{
return luaL_error(L, "searcherAbsolute: internal error: no plugin?");
@@ -348,7 +348,7 @@ int searcherRelative(lua_State *L)
int g_print(lua_State *L)
{
auto *pl = getIApp()->getPlugins()->getPluginByStatePtr(L);
auto *pl = getApp()->getPlugins()->getPluginByStatePtr(L);
if (pl == nullptr)
{
luaL_error(L, "c2_print: internal error: no plugin?");