added watching channel
This commit is contained in:
@@ -341,6 +341,7 @@ void ChannelView::setChannel(ChannelPtr newChannel)
|
||||
if (this->channel) {
|
||||
this->detachChannel();
|
||||
}
|
||||
|
||||
this->messages.clear();
|
||||
|
||||
// on new message
|
||||
@@ -445,15 +446,10 @@ void ChannelView::setChannel(ChannelPtr newChannel)
|
||||
|
||||
void ChannelView::detachChannel()
|
||||
{
|
||||
// on message added
|
||||
if (this->messageAppendedConnection.isConnected()) {
|
||||
this->messageAppendedConnection.disconnect();
|
||||
}
|
||||
|
||||
// on message removed
|
||||
if (this->messageRemovedConnection.isConnected()) {
|
||||
this->messageRemovedConnection.disconnect();
|
||||
}
|
||||
messageAppendedConnection.disconnect();
|
||||
messageAddedAtStartConnection.disconnect();
|
||||
messageRemovedConnection.disconnect();
|
||||
messageReplacedConnection.disconnect();
|
||||
}
|
||||
|
||||
void ChannelView::pause(int msecTimeout)
|
||||
|
||||
@@ -129,6 +129,7 @@ private:
|
||||
pajlada::Signals::Connection layoutConnection;
|
||||
|
||||
std::vector<pajlada::Signals::ScopedConnection> managedConnections;
|
||||
std::vector<pajlada::Signals::ScopedConnection> channelConnections;
|
||||
|
||||
std::unordered_set<std::shared_ptr<messages::MessageLayout>> messagesOnScreen;
|
||||
|
||||
|
||||
@@ -154,14 +154,14 @@ void SplitHeader::scaleChangedEvent(float scale)
|
||||
|
||||
void SplitHeader::updateChannelText()
|
||||
{
|
||||
const QString channelName = this->split->getChannel()->name;
|
||||
auto channel = this->split->getChannel();
|
||||
|
||||
const QString channelName = channel->name;
|
||||
if (channelName.isEmpty()) {
|
||||
this->titleLabel->setText("<no channel>");
|
||||
return;
|
||||
}
|
||||
|
||||
auto channel = this->split->getChannel();
|
||||
|
||||
TwitchChannel *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());
|
||||
|
||||
if (twitchChannel != nullptr) {
|
||||
|
||||
@@ -21,7 +21,7 @@ SplitInput::SplitInput(Split *_chatWidget)
|
||||
{
|
||||
this->initLayout();
|
||||
|
||||
auto completer = new QCompleter(&this->chatWidget->getChannel()->completionModel);
|
||||
auto completer = new QCompleter(&this->chatWidget->getChannel().get()->completionModel);
|
||||
this->ui.textEdit->setCompleter(completer);
|
||||
|
||||
this->chatWidget->channelChanged.connect([this] {
|
||||
|
||||
Reference in New Issue
Block a user