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
+5 -6
View File
@@ -238,11 +238,10 @@ void NativeMessagingServer::ReceiverThread::handleSelect(
postToThread([=] {
if (!name.isEmpty())
{
auto channel =
getIApp()->getTwitchAbstract()->getOrAddChannel(name);
if (getIApp()->getTwitch()->getWatchingChannel().get() != channel)
auto channel = getApp()->getTwitchAbstract()->getOrAddChannel(name);
if (getApp()->getTwitch()->getWatchingChannel().get() != channel)
{
getIApp()->getTwitch()->setWatchingChannel(channel);
getApp()->getTwitch()->setWatchingChannel(channel);
}
}
@@ -253,7 +252,7 @@ void NativeMessagingServer::ReceiverThread::handleSelect(
if (!name.isEmpty())
{
window->setChannel(
getIApp()->getTwitchAbstract()->getOrAddChannel(name));
getApp()->getTwitchAbstract()->getOrAddChannel(name));
}
#endif
}
@@ -305,7 +304,7 @@ void NativeMessagingServer::syncChannels(const QJsonArray &twitchChannels)
}
// the deduping is done on the extension side
updated.emplace_back(
getIApp()->getTwitchAbstract()->getOrAddChannel(name));
getApp()->getTwitchAbstract()->getOrAddChannel(name));
}
// This will destroy channels that aren't used anymore.