-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disconnect controller qt connections #4476
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
146fcb3
Disconnect connections from controllers when deleting controller prefs
ywwg 2c800c3
Controller disconnect: be more restrictive about what we disconnect
ywwg 7b595c0
controller disconnect: store an explicit list of connections
ywwg ab40243
controller disconnect: use the list of controllers to determine what …
ywwg eb937bb
controller disconnect : Make sure to associate the connection with th…
ywwg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should always pass a context object as third parameter (
this
).If we do that we can probably get rid of the list, and just call
disconnect(pController, nullptr, this, nullptr)
to remove all connections between a controller and the dialog.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did that at first, but I was worried that the call to enumerate the list of controllers would be incorrect at the time of destruction. And since disconnect requires the sender object to be specified, we need to make sure that list is complete. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm so it looks like because we don't do hotplug, updateControllerList is only called once, so the list of controllers should be static. However once we go to hotplug, we will have big problems with inconsistency between dlgprefcontrollers and the controllermanager. (And these inconsistencies could easily cause crashes). For now, I'll eliminate the list and trust the the controller list doesn't change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. This is safe code for now, but may not be in the future. Added some comments as hints to future developers trying to add hotplug so they don't trip over this code. (There is no way to write this code currently that would be future-proof)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I understand your comment now. I don't know how to do what you describe though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahhh I figured out which third parameter you meant. got it