renamed SharedChannel to ChannelPtr for consistency
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
|
||||
AccountPopupWidget::AccountPopupWidget(SharedChannel _channel)
|
||||
AccountPopupWidget::AccountPopupWidget(ChannelPtr _channel)
|
||||
: BaseWindow()
|
||||
, ui(new Ui::AccountPopup)
|
||||
, channel(_channel)
|
||||
@@ -172,7 +172,7 @@ void AccountPopupWidget::setName(const QString &name)
|
||||
this->popupWidgetUser.refreshUserType(this->channel, false);
|
||||
}
|
||||
|
||||
void AccountPopupWidget::User::refreshUserType(const SharedChannel &channel, bool loggedInUser)
|
||||
void AccountPopupWidget::User::refreshUserType(const ChannelPtr &channel, bool loggedInUser)
|
||||
{
|
||||
if (channel->name == this->username) {
|
||||
this->userType = UserType::Owner;
|
||||
@@ -183,7 +183,7 @@ void AccountPopupWidget::User::refreshUserType(const SharedChannel &channel, boo
|
||||
}
|
||||
}
|
||||
|
||||
void AccountPopupWidget::setChannel(SharedChannel _channel)
|
||||
void AccountPopupWidget::setChannel(ChannelPtr _channel)
|
||||
{
|
||||
this->channel = _channel;
|
||||
}
|
||||
|
||||
@@ -23,10 +23,10 @@ class AccountPopupWidget : public BaseWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AccountPopupWidget(SharedChannel _channel);
|
||||
AccountPopupWidget(ChannelPtr _channel);
|
||||
|
||||
void setName(const QString &name);
|
||||
void setChannel(SharedChannel _channel);
|
||||
void setChannel(ChannelPtr _channel);
|
||||
|
||||
public slots:
|
||||
void actuallyRefreshButtons();
|
||||
@@ -52,7 +52,7 @@ private:
|
||||
|
||||
enum class UserType { User, Mod, Owner };
|
||||
|
||||
SharedChannel channel;
|
||||
ChannelPtr channel;
|
||||
|
||||
QPixmap avatar;
|
||||
|
||||
@@ -63,7 +63,7 @@ private:
|
||||
QString userID;
|
||||
UserType userType = UserType::User;
|
||||
|
||||
void refreshUserType(const SharedChannel &channel, bool loggedInUser);
|
||||
void refreshUserType(const ChannelPtr &channel, bool loggedInUser);
|
||||
};
|
||||
|
||||
User loggedInUser;
|
||||
|
||||
@@ -32,7 +32,7 @@ EmotePopup::EmotePopup(singletons::ThemeManager &themeManager)
|
||||
this->loadEmojis();
|
||||
}
|
||||
|
||||
void EmotePopup::loadChannel(SharedChannel _channel)
|
||||
void EmotePopup::loadChannel(ChannelPtr _channel)
|
||||
{
|
||||
TwitchChannel *channel = dynamic_cast<TwitchChannel *>(_channel.get());
|
||||
|
||||
@@ -40,7 +40,7 @@ void EmotePopup::loadChannel(SharedChannel _channel)
|
||||
return;
|
||||
}
|
||||
|
||||
SharedChannel emoteChannel(new Channel(""));
|
||||
ChannelPtr emoteChannel(new Channel(""));
|
||||
|
||||
auto addEmotes = [&](util::EmoteMap &map, const QString &title, const QString &emoteDesc) {
|
||||
// TITLE
|
||||
@@ -81,7 +81,7 @@ void EmotePopup::loadEmojis()
|
||||
{
|
||||
util::EmoteMap &emojis = singletons::EmoteManager::getInstance().getEmojis();
|
||||
|
||||
SharedChannel emojiChannel(new Channel(""));
|
||||
ChannelPtr emojiChannel(new Channel(""));
|
||||
|
||||
// title
|
||||
messages::MessageBuilder builder1;
|
||||
|
||||
@@ -12,7 +12,7 @@ class EmotePopup : public BaseWindow
|
||||
public:
|
||||
explicit EmotePopup(singletons::ThemeManager &);
|
||||
|
||||
void loadChannel(SharedChannel channel);
|
||||
void loadChannel(ChannelPtr channel);
|
||||
void loadEmojis();
|
||||
|
||||
private:
|
||||
|
||||
@@ -293,7 +293,7 @@ messages::LimitedQueueSnapshot<MessageLayoutPtr> ChannelView::getMessagesSnapsho
|
||||
return this->snapshot;
|
||||
}
|
||||
|
||||
void ChannelView::setChannel(SharedChannel newChannel)
|
||||
void ChannelView::setChannel(ChannelPtr newChannel)
|
||||
{
|
||||
if (this->channel) {
|
||||
this->detachChannel();
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
void pause(int msecTimeout);
|
||||
void updateLastReadMessage();
|
||||
|
||||
void setChannel(SharedChannel channel);
|
||||
void setChannel(ChannelPtr channel);
|
||||
messages::LimitedQueueSnapshot<messages::MessageLayoutPtr> getMessagesSnapshot();
|
||||
void layoutMessages();
|
||||
|
||||
@@ -84,7 +84,7 @@ private:
|
||||
void setSelection(const messages::SelectionItem &start, const messages::SelectionItem &end);
|
||||
messages::MessageElement::Flags getFlags() const;
|
||||
|
||||
SharedChannel channel;
|
||||
ChannelPtr channel;
|
||||
|
||||
Scrollbar scrollBar;
|
||||
RippleEffectLabel *goToBottom;
|
||||
|
||||
@@ -58,7 +58,7 @@ void SearchPopup::initLayout()
|
||||
}
|
||||
}
|
||||
|
||||
void SearchPopup::setChannel(SharedChannel channel)
|
||||
void SearchPopup::setChannel(ChannelPtr channel)
|
||||
{
|
||||
this->snapshot = channel->getMessageSnapshot();
|
||||
this->performSearch();
|
||||
@@ -70,7 +70,7 @@ void SearchPopup::performSearch()
|
||||
{
|
||||
QString text = searchInput->text();
|
||||
|
||||
SharedChannel channel(new Channel("search"));
|
||||
ChannelPtr channel(new Channel("search"));
|
||||
|
||||
for (size_t i = 0; i < this->snapshot.getLength(); i++) {
|
||||
messages::MessagePtr message = this->snapshot[i];
|
||||
|
||||
@@ -93,7 +93,7 @@ void SplitHeader::addDropdownItems(RippleEffectButton *label)
|
||||
this->dropdownMenu.addSeparator();
|
||||
#ifdef USEWEBENGINE
|
||||
this->dropdownMenu.addAction("Start watching", this, [this]{
|
||||
SharedChannel _channel = this->split->getChannel();
|
||||
ChannelPtr _channel = this->split->getChannel();
|
||||
twitch::TwitchChannel *tc = dynamic_cast<twitch::TwitchChannel *>(_channel.get());
|
||||
|
||||
if (tc != nullptr) {
|
||||
@@ -180,7 +180,7 @@ void SplitHeader::updateModerationModeIcon()
|
||||
: resourceManager.moderationmode_disabled->getPixmap());
|
||||
|
||||
bool modButtonVisible = false;
|
||||
SharedChannel channel = this->split->getChannel();
|
||||
ChannelPtr channel = this->split->getChannel();
|
||||
|
||||
twitch::TwitchChannel *tc = dynamic_cast<twitch::TwitchChannel *>(channel.get());
|
||||
|
||||
|
||||
@@ -132,17 +132,17 @@ const std::string &Split::getUUID() const
|
||||
return this->uuid;
|
||||
}
|
||||
|
||||
SharedChannel Split::getChannel() const
|
||||
ChannelPtr Split::getChannel() const
|
||||
{
|
||||
return this->channel;
|
||||
}
|
||||
|
||||
SharedChannel &Split::getChannelRef()
|
||||
ChannelPtr &Split::getChannelRef()
|
||||
{
|
||||
return this->channel;
|
||||
}
|
||||
|
||||
void Split::setChannel(SharedChannel _newChannel)
|
||||
void Split::setChannel(ChannelPtr _newChannel)
|
||||
{
|
||||
this->view.setChannel(_newChannel);
|
||||
|
||||
@@ -355,7 +355,7 @@ void Split::doClearChat()
|
||||
|
||||
void Split::doOpenChannel()
|
||||
{
|
||||
SharedChannel _channel = this->channel;
|
||||
ChannelPtr _channel = this->channel;
|
||||
twitch::TwitchChannel *tc = dynamic_cast<twitch::TwitchChannel *>(_channel.get());
|
||||
|
||||
if (tc != nullptr) {
|
||||
@@ -365,7 +365,7 @@ void Split::doOpenChannel()
|
||||
|
||||
void Split::doOpenPopupPlayer()
|
||||
{
|
||||
SharedChannel _channel = this->channel;
|
||||
ChannelPtr _channel = this->channel;
|
||||
twitch::TwitchChannel *tc = dynamic_cast<twitch::TwitchChannel *>(_channel.get());
|
||||
|
||||
if (tc != nullptr) {
|
||||
|
||||
@@ -55,8 +55,8 @@ public:
|
||||
}
|
||||
|
||||
const std::string &getUUID() const;
|
||||
SharedChannel getChannel() const;
|
||||
SharedChannel &getChannelRef();
|
||||
ChannelPtr getChannel() const;
|
||||
ChannelPtr &getChannelRef();
|
||||
void setFlexSizeX(double x);
|
||||
double getFlexSizeX();
|
||||
void setFlexSizeY(double y);
|
||||
@@ -83,7 +83,7 @@ protected:
|
||||
|
||||
private:
|
||||
SplitContainer &parentPage;
|
||||
SharedChannel channel;
|
||||
ChannelPtr channel;
|
||||
|
||||
QVBoxLayout vbox;
|
||||
SplitHeader header;
|
||||
@@ -97,7 +97,7 @@ private:
|
||||
boost::signals2::connection channelIDChangedConnection;
|
||||
boost::signals2::connection usermodeChangedConnection;
|
||||
|
||||
void setChannel(SharedChannel newChannel);
|
||||
void setChannel(ChannelPtr newChannel);
|
||||
void doOpenAccountPopupWidget(AccountPopupWidget *widget, QString user);
|
||||
void channelNameUpdated(const std::string &newChannelName);
|
||||
void handleModifiers(QEvent *event, Qt::KeyboardModifiers modifiers);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
StreamView::StreamView(SharedChannel channel, QUrl url)
|
||||
StreamView::StreamView(ChannelPtr channel, QUrl url)
|
||||
{
|
||||
util::LayoutCreator<StreamView> layoutCreator(this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user