initialize activeMargins, now it asserts on startup on icon_p.h#282 rather then crashing what should help to fix the prob ;)
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=839403
This commit is contained in:
parent
f0c70f7c41
commit
6d407b6bad
@ -68,7 +68,8 @@ IconPrivate::IconPrivate(Icon *i)
|
|||||||
numDisplayLines(2),
|
numDisplayLines(2),
|
||||||
invertLayout(false),
|
invertLayout(false),
|
||||||
drawBg(false),
|
drawBg(false),
|
||||||
action(0)
|
action(0),
|
||||||
|
activeMargins(0)
|
||||||
{
|
{
|
||||||
m_hoverAnimId = -1;
|
m_hoverAnimId = -1;
|
||||||
m_hoverAlpha = 20/255;
|
m_hoverAlpha = 20/255;
|
||||||
|
@ -265,24 +265,28 @@ void IconPrivate::setHorizontalMargin(MarginType type, qreal horizontal, qreal v
|
|||||||
|
|
||||||
QRectF IconPrivate::addMargin(const QRectF &rect, MarginType type) const
|
QRectF IconPrivate::addMargin(const QRectF &rect, MarginType type) const
|
||||||
{
|
{
|
||||||
|
Q_ASSERT(activeMargins);
|
||||||
const Margin &m = activeMargins[type];
|
const Margin &m = activeMargins[type];
|
||||||
return rect.adjusted(-m.left, -m.top, m.right, m.bottom);
|
return rect.adjusted(-m.left, -m.top, m.right, m.bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF IconPrivate::subtractMargin(const QRectF &rect, MarginType type) const
|
QRectF IconPrivate::subtractMargin(const QRectF &rect, MarginType type) const
|
||||||
{
|
{
|
||||||
|
Q_ASSERT(activeMargins);
|
||||||
const Margin &m = activeMargins[type];
|
const Margin &m = activeMargins[type];
|
||||||
return rect.adjusted(m.left, m.top, -m.right, -m.bottom);
|
return rect.adjusted(m.left, m.top, -m.right, -m.bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSizeF IconPrivate::addMargin(const QSizeF &size, MarginType type) const
|
QSizeF IconPrivate::addMargin(const QSizeF &size, MarginType type) const
|
||||||
{
|
{
|
||||||
|
Q_ASSERT(activeMargins);
|
||||||
const Margin &m = activeMargins[type];
|
const Margin &m = activeMargins[type];
|
||||||
return QSizeF(size.width() + m.left + m.right, size.height() + m.top + m.bottom);
|
return QSizeF(size.width() + m.left + m.right, size.height() + m.top + m.bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSizeF IconPrivate::subtractMargin(const QSizeF &size, MarginType type) const
|
QSizeF IconPrivate::subtractMargin(const QSizeF &size, MarginType type) const
|
||||||
{
|
{
|
||||||
|
Q_ASSERT(activeMargins);
|
||||||
const Margin &m = activeMargins[type];
|
const Margin &m = activeMargins[type];
|
||||||
return QSizeF(size.width() - m.left - m.right, size.height() - m.top - m.bottom);
|
return QSizeF(size.width() - m.left - m.right, size.height() - m.top - m.bottom);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user