Refactor account labels

Move them out of NeoChatUser, where they don't make any sense
This commit is contained in:
Tobias Fella
2023-04-17 20:56:10 +02:00
committed by Carl Schwan
parent de55253e54
commit f60114c7f6
6 changed files with 49 additions and 32 deletions

View File

@@ -92,7 +92,7 @@ Kirigami.ScrollablePage {
MobileForm.FormTextFieldDelegate {
id: accountLabel
label: i18n("Label:")
text: root.connection ? root.connection.localUser.accountLabel : ""
text: root.connection ? Controller.activeAccountLabel : ""
}
MobileForm.AbstractFormDelegate {
Layout.fillWidth: true
@@ -112,8 +112,8 @@ Kirigami.ScrollablePage {
if (root.connection.localUser.displayName !== name.text) {
root.connection.localUser.rename(name.text);
}
if (root.connection.localUser.accountLabel !== accountLabel.text) {
root.connection.localUser.setAccountLabel(accountLabel.text);
if (Controller.activeAccountLabel !== accountLabel.text) {
Controller.activeAccountLabel = accountLabel.text;
}
}
}