refactor: Remove most raw accesses into Application (#5104)

This commit is contained in:
pajlada
2024-01-19 17:59:55 +01:00
committed by GitHub
parent 326a402710
commit 4380ef8c5f
82 changed files with 552 additions and 452 deletions
+8 -6
View File
@@ -77,7 +77,7 @@ ReplyThreadPopup::ReplyThreadPopup(bool closeAutomatically, Split *split)
{"search", nullptr},
};
this->shortcuts_ = getApp()->hotkeys->shortcutsForCategory(
this->shortcuts_ = getIApp()->getHotkeys()->shortcutsForCategory(
HotkeyCategory::PopupWindow, actions, this);
// initialize UI
@@ -98,7 +98,7 @@ ReplyThreadPopup::ReplyThreadPopup(bool closeAutomatically, Split *split)
new SplitInput(this, this->split_, this->ui_.threadView, false);
this->bSignals_.emplace_back(
getApp()->accounts->twitch.currentUserChanged.connect([this] {
getIApp()->getAccounts()->twitch.currentUserChanged.connect([this] {
this->updateInputUI();
}));
@@ -284,7 +284,7 @@ void ReplyThreadPopup::updateInputUI()
this->ui_.replyInput->setVisible(channel->isWritable());
auto user = getApp()->accounts->twitch.getCurrent();
auto user = getIApp()->getAccounts()->twitch.getCurrent();
QString placeholderText;
if (user->isAnon())
@@ -293,9 +293,11 @@ void ReplyThreadPopup::updateInputUI()
}
else
{
placeholderText =
QStringLiteral("Reply as %1...")
.arg(getApp()->accounts->twitch.getCurrent()->getUserName());
placeholderText = QStringLiteral("Reply as %1...")
.arg(getIApp()
->getAccounts()
->twitch.getCurrent()
->getUserName());
}
this->ui_.replyInput->setPlaceholderText(placeholderText);