1
0

qml: simplify QEConfig and QEDaemon use.

force QEDaemon singleton, and refer to QEDaemon.instance where possible
In cases where we would run into circular dependencies, pass the instance

also refer to singleton QEConfig instead of passing instance in qeapp.py
This commit is contained in:
Sander van Grieken
2025-04-09 13:44:26 +02:00
parent 96793d6e43
commit eb29b7c95c
5 changed files with 36 additions and 34 deletions

View File

@@ -5,8 +5,9 @@ from electrum.plugin import hook
from electrum.util import UserFacingException
from electrum.gui.qml.qewallet import QEWallet
from .common_qt import TrustedcoinPluginQObject
from electrum.gui.qml.qedaemon import QEDaemon
from .common_qt import TrustedcoinPluginQObject
from .trustedcoin import TrustedCoinPlugin, TrustedCoinException
if TYPE_CHECKING:
@@ -44,7 +45,7 @@ class Plugin(TrustedCoinPlugin):
def init_qml(self, app: 'ElectrumQmlApplication'):
self.logger.debug(f'init_qml hook called, gui={str(type(app))}')
self._app = app
wizard = self._app.daemon.newWalletWizard
wizard = QEDaemon.instance.newWalletWizard
# important: TrustedcoinPluginQObject needs to be parented, as keeping a ref
# in the plugin is not enough to avoid gc
# Note: storing the trustedcoin qt helper in the plugin is different from the desktop client,