added watching channel

This commit is contained in:
fourtf
2018-04-20 19:54:45 +02:00
parent e17a7cc222
commit a16a2b0579
14 changed files with 128 additions and 45 deletions
+5 -9
View File
@@ -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)
+1
View File
@@ -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;
+3 -3
View File
@@ -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) {
+1 -1
View File
@@ -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] {