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

@@ -168,7 +168,7 @@ QQC2.ToolBar {
Layout.fillWidth: true
}
QQC2.Label {
text: (Controller.activeConnection.localUser.accountLabel.length > 0 ? (Controller.activeConnection.localUser.accountLabel + " ") : "") + Controller.activeConnection.localUser.id
text: (Controller.activeAccountLabel.length > 0 ? (Controller.activeAccountLabel + " ") : "") + Controller.activeConnection.localUser.id
font.pointSize: displayNameLabel.font.pointSize * 0.8
opacity: 0.7
textFormat: Text.PlainText

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;
}
}
}