if an invalid svg was set, return an empty string as svg()

svn path=/trunk/KDE/kdelibs/; revision=1129430
This commit is contained in:
Marco Martin 2010-05-22 11:35:53 +00:00
parent 891594a433
commit 5f04930024

View File

@ -658,7 +658,11 @@ void IconWidget::setSvg(const QString &svgFilePath, const QString &elementId)
QString IconWidget::svg() const
{
if (d->iconSvg) {
return d->iconSvg->imagePath();
if (d->iconSvg->isValid() && (d->iconSvgElement.isEmpty() || d->iconSvg->hasElement(d->iconSvgElement))) {
return d->iconSvg->imagePath();
} else {
return QString();
}
}
return QString();