diff --git a/freecad/kiconnect/bases/BaseViewProvider.py b/freecad/kiconnect/bases/BaseViewProvider.py index c851818..337e997 100644 --- a/freecad/kiconnect/bases/BaseViewProvider.py +++ b/freecad/kiconnect/bases/BaseViewProvider.py @@ -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])