View Single Post
Old 03-15-2021, 07:01 AM   #380
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,501
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
I am not sure what is happening here. Next time this occurs, please test the condition also in calibre's template tester. If it returns the device name after you have removed it, open a bug report about it. If it is happening only with action chains condition evaluator, report back here.
This is definitely a problem with the semantics of the device_connection_changed signal. The device information available to action chains is still set/valid during the disconnect event. I can see this by adding print() to the disconnect event template.

I can "fix" this in calibre but that will change the information available to every client of the device_connection_changed signal. I am willing to do this if Kovid agrees.

Action chains can fix this by using a QTimer.singleShot(0, ...) to run anything associated with a disconnect event.
chaley is offline   Reply With Quote