qml: use declarative form for invoiceResolved and requestResolved in WalletMainView
What changed, and why it matters
This commit is a minor code-quality refactor in Electrum's mobile/QML user interface. It changes how two internal signals (invoiceResolved and requestResolved) are declared and connected, switching from an imperative connection in Python to a declarative connection in QML. There is no visible security relevance: no input validation, cryptography, network handling, or asset-moving logic is changed.
No security action required. Treat as normal UI maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies electrum/gui/qml/qepiresolver.py to declare invoiceResolved and requestResolved PyQt signals with explicit argument signatures ([object], arguments=[‘pi’]). In electrum/gui/qml/components/WalletMainView.qml it replaces a Component.onCompleted imperative connect() block with onInvoiceResolved/onRequestResolved declarative handlers. This is a syntactic/idiomatic refactor with no functional change to signal emission, payload, or handler behavior.
Changed components
electrum/gui/qml/components/WalletMainView.qmlelectrum/gui/qml/qepiresolver.pyInspect captured patch +8 / −5
diff --git a/electrum/gui/qml/components/WalletMainView.qml b/electrum/gui/qml/components/WalletMainView.qml
index d8f44ce..a9755ac 100644
--- a/electrum/gui/qml/components/WalletMainView.qml
+++ b/electrum/gui/qml/components/WalletMainView.qml
@@ -386,9 +386,12 @@ Item {
dialog.open()
}
- Component.onCompleted: {
- piResolver.invoiceResolved.connect(invoiceParser.fromResolvedPaymentIdentifier)
- piResolver.requestResolved.connect(requestDetails.fromResolvedPaymentIdentifier)
+ onInvoiceResolved: (pi) => {
+ invoiceParser.fromResolvedPaymentIdentifier(pi)
+ }
+
+ onRequestResolved: (pi) => {
+ requestDetails.fromResolvedPaymentIdentifier(pi)
}
}
diff --git a/electrum/gui/qml/qepiresolver.py b/electrum/gui/qml/qepiresolver.py
index 9699a4b..ae3d9e7 100644
--- a/electrum/gui/qml/qepiresolver.py
+++ b/electrum/gui/qml/qepiresolver.py
@@ -17,8 +17,8 @@ class QEPIResolver(QObject):
busyChanged = pyqtSignal()
resolveError = pyqtSignal([str, str], arguments=['code', 'message'])
- invoiceResolved = pyqtSignal(object)
- requestResolved = pyqtSignal(object)
+ invoiceResolved = pyqtSignal([object], arguments=['pi'])
+ requestResolved = pyqtSignal([object], arguments=['pi'])
def __init__(self, parent=None):
super().__init__(parent)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.