Fix removing watching for file modifications#965
Open
dfries wants to merge 3 commits intoUltimaker:5.8from
Open
Fix removing watching for file modifications#965dfries wants to merge 3 commits intoUltimaker:5.8from
dfries wants to merge 3 commits intoUltimaker:5.8from
Conversation
When all files are being reloaded, the file modification reload dialog is redundant. This allows pressing F5 to reload and dismiss the dialog.
They all take the same parameter and it his the SceneNode object to be more specific.
If the file is no longer part of the scene graph no longer watch it for file modifications. This had been triggered from MeshData when it was deleted, but _application was no longer populated so it was not being called. _application could be replaced by querying the current instance. from UM.Application import Application Application.getInstance().getController().getScene().removeWatchedFile(self._file_name) The problem with calling removeWatchedFile from MeshData __del__, is Cura 5.8.1 is creating three MeshData objects with the file name populated, when the file is loaded, two are deleted, the last stays around. If it were to call from the first two objects being deleted, it would remove the watch even though it is loaded as part of the scene. Further I'm seeing that the last object isn't getting deleted, even when it is removed from the scene graph. I don't know if this is a memory leak or if there would still be an issue with undo/redo. Instead listen for the scene graph meshDataChanged signal, collect the files in the scene graph and add or remove based on that list. This does not listen to sceneChanged signal as that includes transform changes, which won't change the set of files listened for.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This depends on (and contains the commits) for pull request Ultimaker/Urandium#964.
If the file is no longer part of the scene graph no longer watch it
for file modifications. This had been triggered from MeshData when it
was deleted, but _application was no longer populated so it was not
being called.
_application could be replaced by querying the current instance.
The problem with calling removeWatchedFile from MeshData
__del__, isCura 5.8.1 is creating three MeshData objects with the file name
populated, when the file is loaded, two are deleted, the last stays
around. If it were to call from the first two objects being deleted,
it would remove the watch even though it is loaded as part of the
scene. Further I'm seeing that the last object isn't getting deleted,
even when it is removed from the scene graph. I don't know if this is
a memory leak or if there would still be an issue with undo/redo.
Instead listen for the scene graph meshDataChanged signal, collect the
files in the scene graph and add or remove based on that list. This
does not listen to sceneChanged signal as that includes transform
changes, which won't change the set of files listened for.
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: