guard pointers, crash--

This commit is contained in:
Marco Martin 2011-06-24 17:56:42 +02:00
parent 25292578ca
commit c4fb39de30
2 changed files with 8 additions and 3 deletions

View File

@ -187,6 +187,9 @@ void DialogProxy::setVisible(const bool visible)
QPoint DialogProxy::popupPosition(QGraphicsObject *item, int alignment) const
{
if (!item) {
return QPoint();
}
Plasma::Corona *corona = qobject_cast<Plasma::Corona *>(item->scene());
if (corona) {
return corona->popupPosition(item, m_dialog->size(), (Qt::AlignmentFlag)alignment);

View File

@ -69,9 +69,11 @@ void SvgItem::setSvg(Plasma::Svg *svg)
disconnect(m_svg.data(), 0, this, 0);
}
m_svg = svg;
connect(svg, SIGNAL(repaintNeeded()), this, SLOT(updateNeeded()));
connect(svg, SIGNAL(repaintNeeded()), this, SIGNAL(naturalSizeChanged()));
connect(svg, SIGNAL(sizeChanged()), this, SIGNAL(naturalSizeChanged()));
if (svg) {
connect(svg, SIGNAL(repaintNeeded()), this, SLOT(updateNeeded()));
connect(svg, SIGNAL(repaintNeeded()), this, SIGNAL(naturalSizeChanged()));
connect(svg, SIGNAL(sizeChanged()), this, SIGNAL(naturalSizeChanged()));
}
emit naturalSizeChanged();
}