Skip to content

Commit

Permalink
- mandatory re-create active applications before intializing them (fo…
Browse files Browse the repository at this point in the history
…r synchronizing properties)

- fix removePort when removing a previously added static port
- document the environment() method
  • Loading branch information
cwiede committed Oct 1, 2020
1 parent 0445ee3 commit cedd112
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nexxT/core/Application.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def initialize():
assertMainThread()
if Application.activeApplication is None:
raise NexTRuntimeError("No active application to initialize")
# make sure that the application is re-created before initializing it
# this is needed to synchronize the properties, etc.
MethodInvoker(Application.activeApplication.getApplication().getConfiguration().activate,
Qt.DirectConnection, Application.activeApplication.getApplication().getName())
MethodInvoker(Application.activeApplication.init, Qt.DirectConnection)
MethodInvoker(Application.activeApplication.open, Qt.DirectConnection)
MethodInvoker(Application.activeApplication.start, Qt.DirectConnection)
Expand Down
5 changes: 5 additions & 0 deletions nexxT/core/FilterEnvironment.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ def removePort(self, port):
:return: None
"""
with QMutexLocker(self._portMutex):
logger.debug("remove port: %s", port)
if useCImpl:
for p in self._ports:
if p.data() == port.data():
port = p
self._ports.remove(port)

def _getInputPorts(self, dynamic):
Expand Down
4 changes: 4 additions & 0 deletions nexxT/interface/Filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ def onDeinit(self):
"""

def environment(self):
"""
Returns the environment associated with this filter.
:return: a FilterEnvironment instance
"""
return _environment

class FilterSurrogate:
Expand Down

0 comments on commit cedd112

Please sign in to comment.