From 87605077cbbe5ccb6f8cd140b8cae23b20a4ad5c Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Sat, 11 Feb 2023 00:06:46 +0100 Subject: [PATCH] Remove unused PluginController::callEvery{,WithArgs} --- src/controllers/plugins/PluginController.cpp | 22 -------------------- src/controllers/plugins/PluginController.hpp | 5 ----- 2 files changed, 27 deletions(-) diff --git a/src/controllers/plugins/PluginController.cpp b/src/controllers/plugins/PluginController.cpp index a20c7e7c0..c8a0df932 100644 --- a/src/controllers/plugins/PluginController.cpp +++ b/src/controllers/plugins/PluginController.cpp @@ -259,28 +259,6 @@ bool PluginController::reload(const QString &codename) return true; } -void PluginController::callEvery(const QString &functionName) -{ - for (const auto &[name, plugin] : this->plugins_) - { - lua_getglobal(plugin->state_, functionName.toStdString().c_str()); - lua_pcall(plugin->state_, 0, 0, 0); - } -} - -void PluginController::callEveryWithArgs( - const QString &functionName, int count, - const std::function &pl, lua_State *L)> - &argCb) -{ - for (const auto &[name, plugin] : this->plugins_) - { - lua_getglobal(plugin->state_, functionName.toStdString().c_str()); - argCb(plugin, plugin->state_); - lua_pcall(plugin->state_, count, 0, 0); - } -} - QString PluginController::tryExecPluginCommand(const QString &commandName, const CommandContext &ctx) { diff --git a/src/controllers/plugins/PluginController.hpp b/src/controllers/plugins/PluginController.hpp index 81ca8f837..51bc98918 100644 --- a/src/controllers/plugins/PluginController.hpp +++ b/src/controllers/plugins/PluginController.hpp @@ -28,11 +28,6 @@ class PluginController : public Singleton public: void initialize(Settings &settings, Paths &paths) override; void save() override{}; - void callEvery(const QString &functionName); - void callEveryWithArgs( - const QString &functionName, int count, - const std::function &pl, - lua_State *L)> &argCb); QString tryExecPluginCommand(const QString &commandName, const CommandContext &ctx);