refactor: Remove most raw accesses into Application (#5104)
This commit is contained in:
@@ -15,20 +15,21 @@ AccountSwitchWidget::AccountSwitchWidget(QWidget *parent)
|
||||
|
||||
this->addItem(ANONYMOUS_USERNAME_LABEL);
|
||||
|
||||
for (const auto &userName : app->accounts->twitch.getUsernames())
|
||||
for (const auto &userName : app->getAccounts()->twitch.getUsernames())
|
||||
{
|
||||
this->addItem(userName);
|
||||
}
|
||||
|
||||
this->managedConnections_.managedConnect(
|
||||
app->accounts->twitch.userListUpdated, [=, this]() {
|
||||
app->getAccounts()->twitch.userListUpdated, [=, this]() {
|
||||
this->blockSignals(true);
|
||||
|
||||
this->clear();
|
||||
|
||||
this->addItem(ANONYMOUS_USERNAME_LABEL);
|
||||
|
||||
for (const auto &userName : app->accounts->twitch.getUsernames())
|
||||
for (const auto &userName :
|
||||
app->getAccounts()->twitch.getUsernames())
|
||||
{
|
||||
this->addItem(userName);
|
||||
}
|
||||
@@ -47,11 +48,11 @@ AccountSwitchWidget::AccountSwitchWidget(QWidget *parent)
|
||||
if (newUsername.compare(ANONYMOUS_USERNAME_LABEL,
|
||||
Qt::CaseInsensitive) == 0)
|
||||
{
|
||||
app->accounts->twitch.currentUsername = "";
|
||||
app->getAccounts()->twitch.currentUsername = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
app->accounts->twitch.currentUsername = newUsername;
|
||||
app->getAccounts()->twitch.currentUsername = newUsername;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -71,7 +72,7 @@ void AccountSwitchWidget::refreshSelection()
|
||||
{
|
||||
auto *app = getApp();
|
||||
|
||||
auto currentUser = app->accounts->twitch.getCurrent();
|
||||
auto currentUser = app->getAccounts()->twitch.getCurrent();
|
||||
|
||||
if (currentUser->isAnon())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user