From kde-commits Sat Dec 31 22:12:27 2005 From: Bart Coppens Date: Sat, 31 Dec 2005 22:12:27 +0000 To: kde-commits Subject: koffice/krita/plugins/viewplugins/histogram Message-Id: <1136067147.483147.14315.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=113606715523293 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;