From de565cdd2a44737e8d8a4f7d2e4eba50f26182a4 Mon Sep 17 00:00:00 2001 From: Mailson Menezes Date: Sat, 10 Nov 2012 01:54:09 -0300 Subject: [PATCH] Reimplement Tile::operator= QList requires its members to have an assignment operator --- core/tile.h | 4 ++-- core/tilesmanager.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/tile.h b/core/tile.h index 76b25ae38..b1451387d 100644 --- a/core/tile.h +++ b/core/tile.h @@ -42,11 +42,11 @@ class OKULAR_EXPORT Tile */ bool isValid() const; + Tile& operator=( const Tile &other ); + private: class Private; Private * d; - - Tile& operator=( const Tile &other ); // Not implemented }; } diff --git a/core/tilesmanager.cpp b/core/tilesmanager.cpp index ca1c0ffaf..00cc81e7c 100644 --- a/core/tilesmanager.cpp +++ b/core/tilesmanager.cpp @@ -613,6 +613,18 @@ Tile::Tile( const Tile &t ) d->isValid = t.d->isValid; } +Tile& Tile::operator=( const Tile &other ) +{ + if ( this == &other ) + return *this; + + d->rect = other.d->rect; + d->pixmap = other.d->pixmap; + d->isValid = other.d->isValid; + + return *this; +} + Tile::~Tile() { delete d;