fix: remove deprecated Application::getTwitchAbstract (#5560)

This commit is contained in:
pajlada
2024-08-25 13:38:57 +02:00
committed by GitHub
parent 3e510fd9e9
commit ac88730563
21 changed files with 45 additions and 69 deletions
+1 -2
View File
@@ -54,8 +54,7 @@ bool FramelessEmbedWindow::nativeEvent(const QByteArray &eventType,
auto channelName = root.value("channel-name").toString();
this->split_->setChannel(
getApp()->getTwitchAbstract()->getOrAddChannel(
channelName));
getApp()->getTwitch()->getOrAddChannel(channelName));
}
}
}
+8 -8
View File
@@ -261,7 +261,7 @@ void Window::addDebugStuff(HotkeyController::HotkeyMap &actions)
const auto &messages = getSampleMiscMessages();
static int index = 0;
const auto &msg = messages[index++ % messages.size()];
getApp()->getTwitchAbstract()->addFakeMessage(msg);
getApp()->getTwitch()->addFakeMessage(msg);
return "";
});
@@ -269,7 +269,7 @@ void Window::addDebugStuff(HotkeyController::HotkeyMap &actions)
const auto &messages = getSampleCheerMessages();
static int index = 0;
const auto &msg = messages[index++ % messages.size()];
getApp()->getTwitchAbstract()->addFakeMessage(msg);
getApp()->getTwitch()->addFakeMessage(msg);
return "";
});
@@ -277,7 +277,7 @@ void Window::addDebugStuff(HotkeyController::HotkeyMap &actions)
const auto &messages = getSampleLinkMessages();
static int index = 0;
const auto &msg = messages[index++ % messages.size()];
getApp()->getTwitchAbstract()->addFakeMessage(msg);
getApp()->getTwitch()->addFakeMessage(msg);
return "";
});
@@ -292,7 +292,7 @@ void Window::addDebugStuff(HotkeyController::HotkeyMap &actions)
oMessage->toInner<PubSubMessageMessage>()
->toInner<PubSubCommunityPointsChannelV1Message>();
getApp()->getTwitchAbstract()->addFakeMessage(
getApp()->getTwitch()->addFakeMessage(
getSampleChannelRewardIRCMessage());
getApp()->getTwitchPubSub()->pointReward.redeemed.invoke(
oInnerMessage->data.value("redemption").toObject());
@@ -316,7 +316,7 @@ void Window::addDebugStuff(HotkeyController::HotkeyMap &actions)
const auto &messages = getSampleEmoteTestMessages();
static int index = 0;
const auto &msg = messages[index++ % messages.size()];
getApp()->getTwitchAbstract()->addFakeMessage(msg);
getApp()->getTwitch()->addFakeMessage(msg);
return "";
});
@@ -324,7 +324,7 @@ void Window::addDebugStuff(HotkeyController::HotkeyMap &actions)
const auto &messages = getSampleSubMessages();
static int index = 0;
const auto &msg = messages[index++ % messages.size()];
getApp()->getTwitchAbstract()->addFakeMessage(msg);
getApp()->getTwitch()->addFakeMessage(msg);
return "";
});
#endif
@@ -487,8 +487,8 @@ void Window::addShortcuts()
splitContainer = this->notebook_->getOrAddSelectedPage();
}
Split *split = new Split(splitContainer);
split->setChannel(getApp()->getTwitchAbstract()->getOrAddChannel(
si.channelName));
split->setChannel(
getApp()->getTwitch()->getOrAddChannel(si.channelName));
split->setFilters(si.filters);
splitContainer->insertSplit(split);
splitContainer->setSelected(split);
+1 -1
View File
@@ -262,7 +262,7 @@ IndirectChannel SelectChannelDialog::getSelectedChannel() const
case TAB_TWITCH: {
if (this->ui_.twitch.channel->isChecked())
{
return getApp()->getTwitchAbstract()->getOrAddChannel(
return getApp()->getTwitch()->getOrAddChannel(
this->ui_.twitch.channelName->text().trimmed());
}
else if (this->ui_.twitch.watching->isChecked())
+3 -4
View File
@@ -305,16 +305,15 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, Split *split)
.getOrAddSelectedPage()
->appendNewSplit(false);
split->setChannel(
app->getTwitchAbstract()->getOrAddChannel(
app->getTwitch()->getOrAddChannel(
loginName.toLower()));
});
menu->addAction(
"Open channel in a new tab", this, [loginName] {
ChannelPtr channel =
getApp()
->getTwitchAbstract()
->getOrAddChannel(loginName);
getApp()->getTwitch()->getOrAddChannel(
loginName);
auto &nb = getApp()
->getWindows()
->getMainWindow()
@@ -21,8 +21,7 @@ NewPopupItem::NewPopupItem(const QString &channelName)
void NewPopupItem::action()
{
auto channel =
getApp()->getTwitchAbstract()->getOrAddChannel(this->channelName_);
auto channel = getApp()->getTwitch()->getOrAddChannel(this->channelName_);
getApp()->getWindows()->openInPopup(channel);
}
+1 -1
View File
@@ -27,7 +27,7 @@ void NewTabItem::action()
Split *split = new Split(container);
split->setChannel(
getApp()->getTwitchAbstract()->getOrAddChannel(this->channelName_));
getApp()->getTwitch()->getOrAddChannel(this->channelName_));
container->insertSplit(split);
}
+2 -2
View File
@@ -2763,8 +2763,8 @@ void ChannelView::showUserInfoPopup(const QString &userName,
auto *userPopup =
new UserInfoPopup(getSettings()->autoCloseUserPopup, this->split_);
auto contextChannel = getApp()->getTwitchAbstract()->getChannelOrEmpty(
alternativePopoutChannel);
auto contextChannel =
getApp()->getTwitch()->getChannelOrEmpty(alternativePopoutChannel);
auto openingChannel = this->hasSourceChannel() ? this->sourceChannel_
: this->underlyingChannel_;
userPopup->setData(userName, contextChannel, openingChannel);
+1 -1
View File
@@ -271,7 +271,7 @@ Split::Split(QWidget *parent)
std::ignore = this->view_->openChannelIn.connect(
[this](QString twitchChannel, FromTwitchLinkOpenChannelIn openIn) {
ChannelPtr channel =
getApp()->getTwitchAbstract()->getOrAddChannel(twitchChannel);
getApp()->getTwitch()->getOrAddChannel(twitchChannel);
switch (openIn)
{
case FromTwitchLinkOpenChannelIn::Split: