Editor: Fix inspector not working when running from source. Fixes #1846819 [Editor Inspector doesn't work when running from source](https://bugs.launchpad.net/calibre/+bug/1846819)

This commit is contained in:
Kovid Goyal 2019-10-05 11:03:19 +05:30
parent e0630cadd3
commit d2d188215c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -320,13 +320,13 @@ class Inspector(QWidget):
self.view = None
self.layout = QHBoxLayout(self)
self.layout.setContentsMargins(0, 0, 0, 0)
self.connection_attempts = 1
self.connection_attempts = 0
QTimer.singleShot(0, self.connect_to_dock)
def connect_to_dock(self):
if 'inspector-dock' not in actions:
self.connection_attempts += 1
if self.connection_attempts < 10:
if self.connection_attempts < 1000:
QTimer.singleShot(10, self.connect_to_dock)
else:
print('Failed to connect to inspector dock')