refactor: Remove most raw accesses into Application (#5104)
This commit is contained in:
@@ -206,7 +206,7 @@ EmotePopup::EmotePopup(QWidget *parent)
|
||||
, notebook_(new Notebook(this))
|
||||
{
|
||||
// this->setStayInScreenRect(true);
|
||||
this->moveTo(getApp()->windows->emotePopupPos(),
|
||||
this->moveTo(getIApp()->getWindows()->emotePopupPos(),
|
||||
widgets::BoundsChecking::DesiredPosition);
|
||||
|
||||
auto *layout = new QVBoxLayout();
|
||||
@@ -273,7 +273,7 @@ EmotePopup::EmotePopup(QWidget *parent)
|
||||
loadEmojis(*this->viewEmojis_,
|
||||
getApp()->getEmotes()->getEmojis()->getEmojis());
|
||||
this->addShortcuts();
|
||||
this->signalHolder_.managedConnect(getApp()->hotkeys->onItemsUpdated,
|
||||
this->signalHolder_.managedConnect(getIApp()->getHotkeys()->onItemsUpdated,
|
||||
[this]() {
|
||||
this->clearShortcuts();
|
||||
this->addShortcuts();
|
||||
@@ -371,7 +371,7 @@ void EmotePopup::addShortcuts()
|
||||
}},
|
||||
};
|
||||
|
||||
this->shortcuts_ = getApp()->hotkeys->shortcutsForCategory(
|
||||
this->shortcuts_ = getIApp()->getHotkeys()->shortcutsForCategory(
|
||||
HotkeyCategory::PopupWindow, actions, this);
|
||||
}
|
||||
|
||||
@@ -394,9 +394,12 @@ void EmotePopup::loadChannel(ChannelPtr channel)
|
||||
auto channelChannel = std::make_shared<Channel>("", Channel::Type::None);
|
||||
|
||||
// twitch
|
||||
addTwitchEmoteSets(
|
||||
getApp()->accounts->twitch.getCurrent()->accessEmotes()->emoteSets,
|
||||
*globalChannel, *subChannel, this->channel_->getName());
|
||||
addTwitchEmoteSets(getIApp()
|
||||
->getAccounts()
|
||||
->twitch.getCurrent()
|
||||
->accessEmotes()
|
||||
->emoteSets,
|
||||
*globalChannel, *subChannel, this->channel_->getName());
|
||||
|
||||
// global
|
||||
if (Settings::instance().enableBTTVGlobalEmotes)
|
||||
@@ -467,8 +470,11 @@ bool EmotePopup::eventFilter(QObject *object, QEvent *event)
|
||||
void EmotePopup::filterTwitchEmotes(std::shared_ptr<Channel> searchChannel,
|
||||
const QString &searchText)
|
||||
{
|
||||
auto twitchEmoteSets =
|
||||
getApp()->accounts->twitch.getCurrent()->accessEmotes()->emoteSets;
|
||||
auto twitchEmoteSets = getIApp()
|
||||
->getAccounts()
|
||||
->twitch.getCurrent()
|
||||
->accessEmotes()
|
||||
->emoteSets;
|
||||
std::vector<std::shared_ptr<TwitchAccount::EmoteSet>> twitchGlobalEmotes{};
|
||||
|
||||
for (const auto &set : twitchEmoteSets)
|
||||
@@ -589,7 +595,7 @@ void EmotePopup::filterEmotes(const QString &searchText)
|
||||
|
||||
void EmotePopup::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
getApp()->windows->setEmotePopupPos(this->pos());
|
||||
getIApp()->getWindows()->setEmotePopupPos(this->pos());
|
||||
BaseWindow::closeEvent(event);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user