From kde-commits Fri Apr 11 16:15:35 2008 From: =?utf-8?q?Ga=C3=ABl=20Beaudoin?= Date: Fri, 11 Apr 2008 16:15:35 +0000 To: kde-commits Subject: extragear/plasma/applets/frame Message-Id: <1207930535.581247.7292.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=120793054709535 SVN commit 795853 by gaboo: put updateGeometry() at a better place I think. And use a temporary local variable in contentSizeHint for easize debugging M +5 -3 frame.cpp --- trunk/extragear/plasma/applets/frame/frame.cpp #795852:795853 @@ -123,12 +123,14 @@ QSizeF Frame::contentSizeHint() const { if (!m_picture.isNull()) { + QSizeF sizeHint; qreal maxSize = contentSize().width() > contentSize().height() ? contentSize().width() : contentSize().height(); if (m_picture.width() > m_picture.height()) { - return QSizeF( maxSize, (maxSize / m_picture.width()) * m_picture.height() ); + sizeHint = QSizeF( maxSize, (maxSize / m_picture.width()) * m_picture.height() ); } else { - return QSizeF( (maxSize / m_picture.height()) * m_picture.width(), maxSize ); + sizeHint = QSizeF( (maxSize / m_picture.height()) * m_picture.width(), maxSize ); } + return sizeHint; } else { return contentSize(); } @@ -324,6 +326,7 @@ { if (m_pixmapCache.isNull() || contentRect().toRect().size() != m_pixmapCache.size()) { + updateGeometry(); paintCache(option, contentRect().toRect().size()); } @@ -408,7 +411,6 @@ p->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); p->drawPath(framePath); } - updateGeometry(); delete p; }