Change const T&& parameters to T&& to enable proper move semantics

Previously some constructors/functions used `const T&&`, which prevents
calling the move constructor. This commit removes the `const` qualifier
so that `std::move` actually performs a move.
This commit is contained in:
Sean Wei 2025-06-18 15:30:00 -04:00 committed by John Preston
parent e6ebc19b4f
commit 5a6a5fd4d1
6 changed files with 6 additions and 6 deletions

View file

@ -789,7 +789,7 @@ void Stickers::somethingReceived(
void Stickers::setPackAndEmoji(
StickersSet &set,
StickersPack &&pack,
const std::vector<TimeId> &&dates,
std::vector<TimeId> &&dates,
const QVector<MTPStickerPack> &packs) {
set.stickers = std::move(pack);
set.dates = std::move(dates);

View file

@ -291,7 +291,7 @@ private:
void setPackAndEmoji(
StickersSet &set,
StickersPack &&pack,
const std::vector<TimeId> &&dates,
std::vector<TimeId> &&dates,
const QVector<MTPStickerPack> &packs);
void somethingReceived(
const QVector<MTPStickerSet> &list,

View file

@ -10,7 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Editor {
ItemImage::ItemImage(
const QPixmap &&pixmap,
QPixmap &&pixmap,
ItemBase::Data data)
: ItemBase(std::move(data))
, _pixmap(std::move(pixmap)) {

View file

@ -14,7 +14,7 @@ namespace Editor {
class ItemImage : public ItemBase {
public:
ItemImage(
const QPixmap &&pixmap,
QPixmap &&pixmap,
ItemBase::Data data);
void paint(
QPainter *p,

View file

@ -11,7 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Editor {
ItemLine::ItemLine(const QPixmap &&pixmap)
ItemLine::ItemLine(QPixmap &&pixmap)
: _pixmap(std::move(pixmap))
, _rect(QPointF(), _pixmap.size() / float64(style::DevicePixelRatio())) {
}

View file

@ -13,7 +13,7 @@ namespace Editor {
class ItemLine : public NumberedItem {
public:
ItemLine(const QPixmap &&pixmap);
ItemLine(QPixmap &&pixmap);
QRectF boundingRect() const override;
void paint(
QPainter *p,