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
@@ -39,7 +39,7 @@ void TabCompletionModel::updateResults(const QString &query,
// Try plugins first
bool done{};
std::tie(done, results) =
getIApp()->getPlugins()->updateCustomCompletions(
getApp()->getPlugins()->updateCustomCompletions(
query, fullTextContent, cursorPosition, isFirstWord);
if (done)
{
@@ -71,20 +71,20 @@ void CommandSource::initializeItems()
std::vector<CommandItem> commands;
#ifdef CHATTERINO_HAVE_PLUGINS
for (const auto &command : getIApp()->getCommands()->pluginCommands())
for (const auto &command : getApp()->getCommands()->pluginCommands())
{
addCommand(command, commands);
}
#endif
// Custom Chatterino commands
for (const auto &command : getIApp()->getCommands()->items)
for (const auto &command : getApp()->getCommands()->items)
{
addCommand(command.name, commands);
}
// Default Chatterino commands
auto x = getIApp()->getCommands()->getDefaultChatterinoCommandList();
auto x = getApp()->getCommands()->getDefaultChatterinoCommandList();
for (const auto &command : x)
{
addCommand(command, commands);
@@ -88,7 +88,7 @@ void EmoteSource::addToStringList(QStringList &list, size_t maxCount,
void EmoteSource::initializeFromChannel(const Channel *channel)
{
auto *app = getIApp();
auto *app = getApp();
std::vector<EmoteItem> emotes;
const auto *tc = dynamic_cast<const TwitchChannel *>(channel);