--- a/eric6/Graphics/UMLClassDiagramBuilder.py Wed May 05 17:29:41 2021 +0200 +++ b/eric6/Graphics/UMLClassDiagramBuilder.py Wed May 05 18:17:24 2021 +0200 @@ -41,6 +41,12 @@ self.file = file self.noAttrs = noAttrs + + self.__relFile = ( + self.project.getRelativePath(self.file) + if self.project.isProjectSource(self.file) else + "" + ) def initialize(self): """ @@ -339,3 +345,23 @@ self.initialize() return True + + def toDict(self): + """ + Public method to collect data to be persisted. + + @return dictionary containing data to be persisted + @rtype dict + """ + data = { + "project_name": self.project.getProjectName(), + "no_attributes": self.noAttrs, + } + + data["file"] = ( + Utilities.fromNativeSeparators(self.__relFile) + if self.__relFile else + Utilities.fromNativeSeparators(self.file) + ) + + return data