ThreePIDModel Updates

There is no need for NeochatConnection to depend on ThreePIdModel and also this means it's not in memory when not needed.

Also a little cleanup to make sure only a single job can run at a time.
This commit is contained in:
James Graham
2025-03-09 12:31:14 +00:00
parent 3f0843647c
commit f9c53ee3b0
10 changed files with 108 additions and 50 deletions

View File

@@ -28,7 +28,10 @@ ColumnLayout {
Repeater {
id: deviceRepeater
model: KSortFilterProxyModel {
sourceModel: root.connection.threePIdModel
sourceModel: ThreePIdModel {
id: threePIdModel
connection: root.connection
}
filterRoleName: "medium"
filterString: root.medium
}
@@ -110,6 +113,9 @@ ColumnLayout {
connection: root.connection
newId: threePIdDelegate.address
medium: threePIdDelegate.medium
onThreePIdBound: threePIdModel.refreshModel()
onThreePIdUnbound: threePIdModel.refreshModel()
}
}
@@ -130,7 +136,7 @@ ColumnLayout {
label: i18nc("@label:textbox", "Country Code for new phone number")
Connections {
target: root.connection.threePIdModel
target: threePIdModel
function onModelReset() {
newCountryCode.text = ""
@@ -170,7 +176,7 @@ ColumnLayout {
onAccepted: _private.openPasswordSheet()
Connections {
target: root.connection.threePIdModel
target: threePIdModel
function onModelReset() {
newId.text = ""
@@ -198,6 +204,10 @@ ColumnLayout {
connection: root.connection
medium: root.medium
newId: newId.text
onThreePIdAdded: threePIdModel.refreshModel()
onThreePIdRemoved: threePIdModel.refreshModel()
onThreePIdUnbound: threePIdModel.refreshModel()
}
QtObject {