Skip to content

Commit c9fe8ff

Browse files
committed
hal_glib.py: prevent emitting 'file-loaded' if file_new is empty.
Fixes an edge case where 'file-loaded' would be emitted even if file_new was empty. This was inadvertantly caused by commit 40e4a23. The edge case surrounds calling a subroutine from file via MDI before any other file was loaded.
1 parent 1e72f87 commit c9fe8ff

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/python/hal_glib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ def update(self):
491491
# file name if call level != 0 in the merge() function above.
492492
# do avoid that a signal is emitted in that case, causing
493493
# a reload of the preview and sourceview widgets
494-
if self.stat.interp_state == linuxcnc.INTERP_IDLE:
494+
if self.stat.interp_state == linuxcnc.INTERP_IDLE and file_new != "":
495495
self.emit('file-loaded', file_new)
496496

497497
#ToDo : Find a way to avoid signal when the line changed due to

0 commit comments

Comments
 (0)