SVN commit 492989 by coppens: No const_cast M +2 -2 histogram.cc M +2 -0 histogram.h --- trunk/koffice/krita/plugins/viewplugins/histogram/histogram.cc #492988:492989 @@ -80,6 +80,7 @@ this, SLOT(slotLayersChanged())); connect(img, SIGNAL(sigLayerMoved(KisLayerSP, KisGroupLayerSP, KisLayerSP)), this, SLOT(slotLayersChanged())); + m_img = img; } } } @@ -89,8 +90,7 @@ } void Histogram::slotLayersChanged() { - KisImageSP img = dynamic_cast(const_cast(sender())); //bah - m_action -> setEnabled(img && img -> activeLayer() && img -> activeLayer() -> visible()); + m_action -> setEnabled(m_img && m_img -> activeLayer() && m_img -> activeLayer() -> visible()); } void Histogram::slotActivated() --- trunk/koffice/krita/plugins/viewplugins/histogram/histogram.h #492988:492989 @@ -25,6 +25,7 @@ class KisView; class KAction; +class KisImage; class Histogram : public KParts::Plugin { @@ -38,6 +39,7 @@ void slotLayersChanged(); private: + KisImage* m_img; KisView * m_view; KisPainter * m_painter; KAction* m_action;