blueman icon indicating copy to clipboard operation
blueman copied to clipboard

ManagerDeviceMenu: Do not assume all instances have been generated

Open infirit opened this issue 3 years ago • 3 comments

If the right click instance has never been used and the user double clicks to connect it will not have a SelectedDevice yet.

infirit avatar Oct 07 '22 12:10 infirit

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Oct 07 '22 12:10 sonarqubecloud[bot]

Wouldn't it be better to skip the instances that have not been generated with next instead of returning from the loop?

sudoaza avatar Oct 08 '22 12:10 sudoaza

Not next but continue may be wise here as the order may change at some point. I'll fix that.

infirit avatar Oct 12 '22 15:10 infirit

Thank you @infirit <3

sudoaza avatar Oct 18 '22 18:10 sudoaza

@infirit: We fail to lock the "Device" menu with this.

If I double-click a device to connect, the right-click menu gets locked, i.e. it shows only a single, disabled "Connecting..." item. The same is expected for the "Device" menu in the menu bar but it's not the case. If I select a different device and then switch back, the menu is locked as expected as it got re-generated in the meantime.

cschramm avatar Dec 31 '22 14:12 cschramm

ok, generating all instances it is then. I'll open a new PR for this.

infirit avatar Dec 31 '22 15:12 infirit