Fix change signaling when tool session path changes - #21
Open
BrennanTM wants to merge 1 commit into
Open
Conversation
Two defects in the sessionPath setters: - Tool.sessionPath: a missing comma merged 'trackerStlFilepath' and 'sessionPath' into one bogus attrib name via implicit string concatenation, so those attribs were never announced as changed. - Tools.sessionPath: compared the resolved filepathsRelTo path against the literal token '<session>' (never true), so session-relative tools were always excluded from the emitted changingKeys. Use filepathsRelToKey instead, and pass the changed attrib names in the emit as done everywhere else in GenericCollection. The attrib list is hoisted to a single module-level constant so the two setters can't drift apart again. Side effects of the collection-level change worth noting: the old emit (empty keys, implicit attribs=None) made CollectionTableModel classify every session move as a 'full' layout change with a spurious selection-cleared signal, and made ToolsPanel spawn a throwaway ToolPositionsClient; the new emit is classified as 'modifyExisting' and neither side effect occurs.
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.
What broke — two defects in the
sessionPathsetters (Navigator/Model/Tools.py):Tool.sessionPath: a missing comma merged'trackerStlFilepath'and'sessionPath'into one bogus attrib name (implicit string concatenation), so those attribs were never signaled as changed.Tools.sessionPath: compared the resolvedfilepathsRelTopath against the token'<session>'(never true), so session-relative tools were always left out ofchangingKeys.Fix — compare
filepathsRelToKey; pass the changed attrib names as the second emit arg (as everywhere else inGenericCollection); hoist the attrib list to one module constant so the two setters can't drift again.Side effect (improvement) — the old empty-keys emit made
CollectionTableModeltreat every session move as a full layout reset and madeToolsPanelspawn a throwawayToolPositionsClient; both stop happening. All existing subscribers already accept the two-arg form.Tests —
tests/test_Model/test_toolsSessionPath.py(2).