Retrieve file features for templates

When a project file is opened as such, its filepath is stored
and all its features are retrieved as a consequence. Templates
were hard-coded instead of opened as files, so there never was
any need to load their features.

Now that .mg files can be opened both as projects and pipelines,
we need to retrieve the features in both cases, whether the filepath
is stored (file opened as project) or not (file opened as template).
This can be useful to retrieve the layout contained in the .mg file
for the pipeline, for example.
This commit is contained in:
Candice Bentéjac 2022-07-21 15:28:36 +02:00
parent 578c1f01c0
commit 945f59e00c

View file

@ -236,8 +236,6 @@ class Graph(BaseObject):
@property
def fileFeatures(self):
""" Get loaded file supported features based on its version. """
if not self._filepath:
return []
return Graph.IO.getFeaturesForVersion(self.header.get(Graph.IO.Keys.FileVersion, "0.0"))
@Slot(str)