clang-tidy: use std::move where applicable (#2605)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -143,7 +143,7 @@ void AttachedWindow::detach(const QString &winId)
|
||||
|
||||
void AttachedWindow::setChannel(ChannelPtr channel)
|
||||
{
|
||||
this->ui_.split->setChannel(channel);
|
||||
this->ui_.split->setChannel(std::move(channel));
|
||||
}
|
||||
|
||||
void AttachedWindow::showEvent(QShowEvent *)
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
namespace chatterino {
|
||||
|
||||
Label::Label(QString text, FontStyle style)
|
||||
: Label(nullptr, text, style)
|
||||
: Label(nullptr, std::move(text), style)
|
||||
{
|
||||
}
|
||||
|
||||
Label::Label(BaseWidget *parent, QString text, FontStyle style)
|
||||
: BaseWidget(parent)
|
||||
, text_(text)
|
||||
, text_(std::move(text))
|
||||
, fontStyle_(style)
|
||||
{
|
||||
this->connections_.managedConnect(getFonts()->fontChanged, [this] {
|
||||
|
||||
@@ -26,7 +26,7 @@ StreamView::StreamView(ChannelPtr channel, const QUrl &url)
|
||||
|
||||
auto chat = layoutCreator.emplace<ChannelView>();
|
||||
chat->setFixedWidth(300);
|
||||
chat->setChannel(channel);
|
||||
chat->setChannel(std::move(channel));
|
||||
|
||||
this->layout()->setSpacing(0);
|
||||
this->layout()->setMargin(0);
|
||||
|
||||
@@ -45,7 +45,7 @@ void NotificationPopup::updatePosition()
|
||||
|
||||
void NotificationPopup::addMessage(MessagePtr msg)
|
||||
{
|
||||
this->channel_->addMessage(msg);
|
||||
this->channel_->addMessage(std::move(msg));
|
||||
|
||||
// QTimer::singleShot(5000, this, [this, msg] { this->channel->remove });
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ Button::Button(BaseWidget *parent)
|
||||
|
||||
void Button::setMouseEffectColor(boost::optional<QColor> color)
|
||||
{
|
||||
this->mouseEffectColor_ = color;
|
||||
this->mouseEffectColor_ = std::move(color);
|
||||
}
|
||||
|
||||
void Button::setPixmap(const QPixmap &_pixmap)
|
||||
|
||||
@@ -550,7 +550,7 @@ bool ChannelView::getEnableScrollingToBottom() const
|
||||
|
||||
void ChannelView::setOverrideFlags(boost::optional<MessageElementFlags> value)
|
||||
{
|
||||
this->overrideFlags_ = value;
|
||||
this->overrideFlags_ = std::move(value);
|
||||
}
|
||||
|
||||
const boost::optional<MessageElementFlags> &ChannelView::getOverrideFlags()
|
||||
@@ -647,7 +647,7 @@ void ChannelView::setChannel(ChannelPtr underlyingChannel)
|
||||
this->channelConnections_.push_back(this->channel_->messageAppended.connect(
|
||||
[this](MessagePtr &message,
|
||||
boost::optional<MessageFlags> overridingFlags) {
|
||||
this->messageAppended(message, overridingFlags);
|
||||
this->messageAppended(message, std::move(overridingFlags));
|
||||
}));
|
||||
|
||||
this->channelConnections_.push_back(
|
||||
@@ -753,7 +753,7 @@ ChannelPtr ChannelView::sourceChannel() const
|
||||
|
||||
void ChannelView::setSourceChannel(ChannelPtr sourceChannel)
|
||||
{
|
||||
this->sourceChannel_ = sourceChannel;
|
||||
this->sourceChannel_ = std::move(sourceChannel);
|
||||
}
|
||||
|
||||
bool ChannelView::hasSourceChannel() const
|
||||
|
||||
@@ -66,7 +66,7 @@ SearchPopup::SearchPopup(QWidget *parent)
|
||||
|
||||
void SearchPopup::setChannelFilters(FilterSetPtr filters)
|
||||
{
|
||||
this->channelFilters_ = filters;
|
||||
this->channelFilters_ = std::move(filters);
|
||||
}
|
||||
|
||||
void SearchPopup::setChannel(const ChannelPtr &channel)
|
||||
|
||||
Reference in New Issue
Block a user