Chore: Proper Lambda Formatting (#2167)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
+11
-6
@@ -38,13 +38,16 @@ namespace detail {
|
||||
DebugCount::increase("animated images");
|
||||
|
||||
this->gifTimerConnection_ =
|
||||
getApp()->emotes->gifTimer.signal.connect(
|
||||
[this] { this->advance(); });
|
||||
getApp()->emotes->gifTimer.signal.connect([this] {
|
||||
this->advance();
|
||||
});
|
||||
}
|
||||
|
||||
auto totalLength = std::accumulate(
|
||||
this->items_.begin(), this->items_.end(), 0UL,
|
||||
[](auto init, auto &&frame) { return init + frame.duration; });
|
||||
auto totalLength =
|
||||
std::accumulate(this->items_.begin(), this->items_.end(), 0UL,
|
||||
[](auto init, auto &&frame) {
|
||||
return init + frame.duration;
|
||||
});
|
||||
|
||||
if (totalLength == 0)
|
||||
{
|
||||
@@ -222,7 +225,9 @@ Image::~Image()
|
||||
// run destructor of Frames in gui thread
|
||||
if (!isGuiThread())
|
||||
{
|
||||
postToThread([frames = this->frames_.release()]() { delete frames; });
|
||||
postToThread([frames = this->frames_.release()]() {
|
||||
delete frames;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -352,7 +352,7 @@ void TextElement::addToContainer(MessageLayoutContainer &container,
|
||||
|
||||
// QChar::isHighSurrogate(text[0].unicode()) ? 2 : 1
|
||||
|
||||
for (int i = 0; i < textLength; i++) //
|
||||
for (int i = 0; i < textLength; i++)
|
||||
{
|
||||
auto isSurrogate = text.size() > i + 1 &&
|
||||
QChar::isHighSurrogate(text[i].unicode());
|
||||
@@ -360,7 +360,7 @@ void TextElement::addToContainer(MessageLayoutContainer &container,
|
||||
auto charWidth = isSurrogate ? metrics.width(text.mid(i, 2))
|
||||
: metrics.width(text[i]);
|
||||
|
||||
if (!container.fitsInLine(width + charWidth)) //
|
||||
if (!container.fitsInLine(width + charWidth))
|
||||
{
|
||||
container.addElementNoLineBreak(getTextLayoutElement(
|
||||
text.mid(wordStart, i - wordStart), width, false));
|
||||
@@ -621,7 +621,7 @@ void IrcTextElement::addToContainer(MessageLayoutContainer &container,
|
||||
// QChar::isHighSurrogate(text[0].unicode()) ? 2 : 1
|
||||
|
||||
// XXX(pajlada): NOT TESTED
|
||||
for (int i = 0; i < textLength; i++) //
|
||||
for (int i = 0; i < textLength; i++)
|
||||
{
|
||||
auto isSurrogate = text.size() > i + 1 &&
|
||||
QChar::isHighSurrogate(text[i].unicode());
|
||||
|
||||
@@ -356,7 +356,7 @@ void SharedMessageBuilder::appendChannelName()
|
||||
Link link(Link::Url, this->channel->getName() + "\n" + this->message().id);
|
||||
|
||||
this->emplace<TextElement>(channelName, MessageElementFlag::ChannelName,
|
||||
MessageColor::System) //
|
||||
MessageColor::System)
|
||||
->setLink(link);
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ void MessageLayout::actuallyLayout(int width, MessageElementFlags flags)
|
||||
|
||||
if (this->flags.has(MessageLayoutFlag::Expanded) ||
|
||||
(flags.has(MessageElementFlag::ModeratorTools) &&
|
||||
!this->message_->flags.has(MessageFlag::Disabled))) //
|
||||
!this->message_->flags.has(MessageFlag::Disabled)))
|
||||
{
|
||||
messageFlags.unset(MessageFlag::Collapsed);
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ void MessageLayoutContainer::paintSelection(QPainter &painter, int messageIndex,
|
||||
// ends in same line
|
||||
if (selection.selectionMax.messageIndex == messageIndex &&
|
||||
line.endCharIndex >
|
||||
/*=*/selection.selectionMax.charIndex) //
|
||||
/*=*/selection.selectionMax.charIndex)
|
||||
{
|
||||
returnAfter = true;
|
||||
index = line.startCharIndex;
|
||||
|
||||
@@ -217,7 +217,7 @@ void TextLayoutElement::listenToLinkChanges()
|
||||
.linkChanged.connect([this]() {
|
||||
// log("Old link: {}", this->getCreator().getLink().value);
|
||||
// log("This link: {}", this->getLink().value);
|
||||
this->setLink(this->getCreator().getLink()); //
|
||||
this->setLink(this->getCreator().getLink());
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user