Skip file open events in dev mode

This commit is contained in:
Micah Lee 2021-07-02 10:10:01 -07:00
parent ed4586a051
commit 0b1d8f6a3e
No known key found for this signature in database
GPG key ID: 403C2657CD994F73

View file

@ -35,8 +35,10 @@ class ApplicationWrapper(QtCore.QObject):
def monkeypatch_event(event): def monkeypatch_event(event):
# In macOS, handle the file open event # In macOS, handle the file open event
if event.type() == QtCore.QEvent.FileOpen: if event.type() == QtCore.QEvent.FileOpen:
self.document_selected.emit(event.file()) # Skip file open events in dev mode
return True if not sys.dangerzone_dev:
self.document_selected.emit(event.file())
return True
elif event.type() == QtCore.QEvent.ApplicationActivate: elif event.type() == QtCore.QEvent.ApplicationActivate:
self.application_activated.emit() self.application_activated.emit()
return True return True