if an invalid svg was set, return an empty string as svg()
svn path=/trunk/KDE/kdelibs/; revision=1129430
This commit is contained in:
parent
891594a433
commit
5f04930024
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user