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
+8 -8
View File
@@ -140,7 +140,7 @@ auto formatTooltip(const TwitchChannel::StreamStatus &s, QString thumbnail)
}();
auto extraStreamData = [&s]() -> QString {
if (getIApp()->getStreamerMode()->isEnabled() &&
if (getApp()->getStreamerMode()->isEnabled() &&
getSettings()->streamerModeHideViewerCountAndDuration)
{
return QStringLiteral(
@@ -246,7 +246,7 @@ SplitHeader::SplitHeader(Split *split)
});
this->bSignals_.emplace_back(
getIApp()->getAccounts()->twitch.currentUserChanged.connect([this] {
getApp()->getAccounts()->twitch.currentUserChanged.connect([this] {
this->updateIcons();
}));
@@ -311,7 +311,7 @@ void SplitHeader::initializeLayout()
case Qt::LeftButton:
if (getSettings()->moderationActions.empty())
{
getIApp()->getWindows()->showSettingsDialog(
getApp()->getWindows()->showSettingsDialog(
this, SettingsDialogPreference::
ModerationActions);
this->split_->setModerationMode(true);
@@ -329,7 +329,7 @@ void SplitHeader::initializeLayout()
case Qt::RightButton:
case Qt::MiddleButton:
getIApp()->getWindows()->showSettingsDialog(
getApp()->getWindows()->showSettingsDialog(
this,
SettingsDialogPreference::ModerationActions);
break;
@@ -379,7 +379,7 @@ void SplitHeader::initializeLayout()
std::unique_ptr<QMenu> SplitHeader::createMainMenu()
{
// top level menu
const auto &h = getIApp()->getHotkeys();
const auto &h = getApp()->getHotkeys();
auto menu = std::make_unique<QMenu>();
menu->addAction(
"Change channel", this->split_, &Split::changeChannel,
@@ -552,11 +552,11 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
action->setShortcut(notifySeq);
QObject::connect(moreMenu, &QMenu::aboutToShow, this, [action, this]() {
action->setChecked(getIApp()->getNotifications()->isChannelNotified(
action->setChecked(getApp()->getNotifications()->isChannelNotified(
this->split_->getChannel()->getName(), Platform::Twitch));
});
QObject::connect(action, &QAction::triggered, this, [this]() {
getIApp()->getNotifications()->updateChannelNotification(
getApp()->getNotifications()->updateChannelNotification(
this->split_->getChannel()->getName(), Platform::Twitch);
});
@@ -1078,7 +1078,7 @@ void SplitHeader::reloadSubscriberEmotes()
this->lastReloadedSubEmotes_ = now;
auto channel = this->split_->getChannel();
getIApp()->getAccounts()->twitch.getCurrent()->loadEmotes(channel);
getApp()->getAccounts()->twitch.getCurrent()->loadEmotes(channel);
}
void SplitHeader::reconnect()