only set an image when we have one

This commit is contained in:
Aaron Seigo 2011-11-30 15:15:38 +01:00
parent ee81650232
commit 35580a01be

View File

@ -163,7 +163,12 @@ void ToolTipProxy::updateToolTip()
Plasma::ToolTipContent data;
data.setMainText(m_mainText);
data.setSubText(m_subText);
data.setImage(KIcon(m_image).pixmap(IconSize(KIconLoader::Desktop)));
if (!m_image.isEmpty()) {
KIcon icon(m_image);
if (!icon.isNull()) {
data.setImage(icon.pixmap(IconSize(KIconLoader::Desktop)));
}
}
Plasma::ToolTipManager::self()->setContent(m_widget, data);
}