Commit fb2738ef authored by Michael Abrahams's avatar Michael Abrahams

Assignment operator is not a const function

MSVC 2015 caught this and refused to compile.  We were playing fast and
loose with const in a few places, doing naughty things like putting
const pointers on the left hand side of an assignment operator.
parent 6e6c0cec
......@@ -32,10 +32,10 @@
KisHistogram::KisHistogram(const KisPaintLayerSP layer,
KoHistogramProducerSP producer,
const enumHistogramType type)
: m_paintDevice(layer->projection())
{
Q_ASSERT(producer);
m_paintDevice = layer->projection();
m_bounds = layer->image()->bounds();
m_type = type;
m_producer = producer;
......@@ -49,10 +49,10 @@ KisHistogram::KisHistogram(const KisPaintDeviceSP paintdev,
const QRect &bounds,
KoHistogramProducerSP producer,
const enumHistogramType type)
: m_paintDevice(paintdev)
{
Q_ASSERT(producer);
m_paintDevice = paintdev;
m_bounds = bounds;
m_producer = producer;
m_type = type;
......
......@@ -87,7 +87,7 @@ public:
inline KisSharedPtr(const KisWeakSharedPtr<T>& o);
// Free the pointer and set it to new value
void attach(T* p) const;
void attach(T* p);
// Free the pointer
void clear();
......@@ -113,10 +113,6 @@ public:
attach(o.d);
return *this;
}
inline const KisSharedPtr<T>& operator= (const KisSharedPtr& o) const {
attach(o.d);
return *this;
}
inline bool operator== (const T* p) const {
return (d == p);
}
......@@ -286,10 +282,7 @@ public:
attach(o);
return *this;
}
inline const KisWeakSharedPtr<T>& operator= (const KisWeakSharedPtr& o) const {
attach(o);
return *this;
}
inline bool operator== (const T* p) const {
return (d == p);
}
......@@ -496,7 +489,7 @@ Q_INLINE_TEMPLATE KisSharedPtr<T>::KisSharedPtr(const KisWeakSharedPtr<T>& o)
template <class T>
Q_INLINE_TEMPLATE void KisSharedPtr<T>::attach(T* p) const
Q_INLINE_TEMPLATE void KisSharedPtr<T>::attach(T* p)
{
if (d != p) {
ref(this, p);
......
......@@ -83,7 +83,7 @@ private:
QGridLayout* m_layout;
KisFilterOptionWidget* m_options;
const KisFilterSP m_currentFilter;
KisFilterSP m_currentFilter;
KisConfigWidget* m_currentFilterConfigWidget;
KisPaintDeviceSP m_paintDevice;
KisImageSP m_image;
......
......@@ -79,7 +79,7 @@ private:
const KisShapeProperties * m_shapeProperties;
const KisShapeDynamicsProperties * m_shapeDynamicsProperties;
const KisBrushSP m_brush;
KisBrushSP m_brush;
KisFixedPaintDeviceSP m_fixedDab;
private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment