Skip to content

Commit

Permalink
Addons manager - check if macro icon path exists [skip ci]
Browse files Browse the repository at this point in the history
I noticed Macros tab suffers from the same issue: #3015

Hence the same fix.
  • Loading branch information
triplus authored and yorikvanhavre committed Feb 12, 2020
1 parent b94b404 commit 20c0a7c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Mod/AddonManager/AddonManager.py
Expand Up @@ -385,7 +385,11 @@ def add_macro(self, macro):
from PySide import QtGui
self.macros.append(macro)
import AddonManager_rc
addonicon = QtGui.QIcon(":/icons/" + macro.name.replace(" ","_") + "_macro_icon.svg")
path = ":/icons/" + macro.name.replace(" ","_") + "_macro_icon.svg"
if QtCore.QFile.exists(path):
addonicon = QtGui.QIcon(path)
else:
addonicon = QtGui.QIcon(":/icons/document-python.svg")
if addonicon.isNull():
addonicon = QtGui.QIcon(":/icons/document-python.svg")
if macro.is_installed():
Expand Down

0 comments on commit 20c0a7c

Please sign in to comment.