Mares Smart Dive Computer + Bluelink pro

Berthold Stoeger bstoeger at mail.tuwien.ac.at
Tue Sep 25 15:49:49 PDT 2018


On Wednesday, 26 September 2018 00:19:58 CEST Linus Torvalds wrote:

> We end up connecting the "hey, characteristic value changed" to
> *every* service we find. And that's fine for the cases where we only
> had one service.
> 
> But in the BlueLink case, it means that the last service we find will
> *override* the signal we registered for the service we actually care
> about.

Qt's signal/slot system is horrible. Signal connections usually aren't 
overridden but added to a list. On the contrary, a rather common error-case we 
experience is double-connections, where the receiver is told to delete an item 
twice. If you want Qt to ensure that a connection between the same objects 
isn't established twice, you have to pass the Qt::UniqueConnection flag.

In any case, connecting to every service seems like a bad idea.

Berthold




More information about the subsurface mailing list