renamed SharedChannel to ChannelPtr for consistency

This commit is contained in:
fourtf
2018-01-24 13:15:41 +01:00
parent fa344deaf0
commit 2b94c4cd33
17 changed files with 46 additions and 46 deletions
+3 -3
View File
@@ -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;
}
+4 -4
View File
@@ -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;
+3 -3
View File
@@ -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;
+1 -1
View File
@@ -12,7 +12,7 @@ class EmotePopup : public BaseWindow
public:
explicit EmotePopup(singletons::ThemeManager &);
void loadChannel(SharedChannel channel);
void loadChannel(ChannelPtr channel);
void loadEmojis();
private:
+1 -1
View File
@@ -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();
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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];
+2 -2
View File
@@ -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());
+5 -5
View File
@@ -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) {
+4 -4
View File
@@ -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);
+1 -1
View File
@@ -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);