preserve icon through doc restore

This commit is contained in:
Morgan 'ARR\!' Allen 2025-03-29 00:12:03 -07:00
parent c4c2b80892
commit ca9a0e5faa

View file

@ -9,6 +9,8 @@ class BaseViewProvider:
self.parent = parent
self.viewprovider = viewprovider
self.icon = os.path.join(settings.ICONPATH, self.parent.__class__.ICON)
viewprovider.Proxy = self
self.Type = ''
@ -32,7 +34,7 @@ class BaseViewProvider:
Gui.Selection.clearSelection()
def getIcon(self):
return os.path.join(settings.ICONPATH, self.parent.__class__.ICON)
return self.icon
def getDisplayModes(self,obj):
'''Return a list of display modes.'''
@ -43,4 +45,10 @@ class BaseViewProvider:
return 'Standard'
def __getstate__(self):
return None
return {
'icon': self.icon
}
def __setstate__(self, props):
for prop in props:
setattr(self, prop, props[prop])