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:
@@ -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)) {
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Editor {
|
||||
class ItemImage : public ItemBase {
|
||||
public:
|
||||
ItemImage(
|
||||
const QPixmap &&pixmap,
|
||||
QPixmap &&pixmap,
|
||||
ItemBase::Data data);
|
||||
void paint(
|
||||
QPainter *p,
|
||||
|
||||
@@ -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())) {
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user