check for elementId besides the file name
This commit is contained in:
parent
7b6d50b3c6
commit
03495debc4
@ -87,13 +87,13 @@ void IconItem::setSource(const QVariant &source)
|
|||||||
m_svgIcon->setImagePath("toolbar-icons/" + source.toString().split("-").first());
|
m_svgIcon->setImagePath("toolbar-icons/" + source.toString().split("-").first());
|
||||||
|
|
||||||
//try as a svg normal icon (like systray)
|
//try as a svg normal icon (like systray)
|
||||||
if (!m_svgIcon->isValid()) {
|
if (!m_svgIcon->isValid() || !m_svgIcon->hasElement(m_source.toString())) {
|
||||||
m_svgIcon->setImagePath("icons/" + source.toString().split("-").first());
|
m_svgIcon->setImagePath("icons/" + source.toString().split("-").first());
|
||||||
}
|
}
|
||||||
m_svgIcon->setContainsMultipleImages(true);
|
m_svgIcon->setContainsMultipleImages(true);
|
||||||
|
|
||||||
//success?
|
//success?
|
||||||
if (m_svgIcon->isValid()) {
|
if (m_svgIcon->isValid() && m_svgIcon->hasElement(m_source.toString())) {
|
||||||
m_icon = QIcon();
|
m_icon = QIcon();
|
||||||
|
|
||||||
//ok, svg not available
|
//ok, svg not available
|
||||||
|
Loading…
Reference in New Issue
Block a user