From 8521eba418e55dcd5ad1ad338144610d0ee148d9 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 6 Jul 2025 21:53:13 -0400 Subject: [PATCH] [PATCH] Make sure that toggling account options affects the correct account (cherry picked from commit 8c8a0519a82fea6aaaf49f6022b4b497e66d07ae) Gbp-Pq: Name upstream_4643870b_Make-sure-that-toggling-account-options-affects-the-correct-account.patch --- src/content/ui/Settings/AccountPage.qml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/content/ui/Settings/AccountPage.qml b/src/content/ui/Settings/AccountPage.qml index 213f6d8..501c360 100644 --- a/src/content/ui/Settings/AccountPage.qml +++ b/src/content/ui/Settings/AccountPage.qml @@ -14,7 +14,7 @@ import ".." Kirigami.Page { id: root - property var account + property AbstractAccount account readonly property ProfileEditorBackend backend : ProfileEditorBackend { account: root.account @@ -166,8 +166,8 @@ Kirigami.Page { FormCard.FormSwitchDelegate { text: i18nc("@label Account preferences", "Mark uploaded media as sensitive by default") - checked: AccountManager.selectedAccount.preferences.defaultSensitive - onToggled: AccountManager.selectedAccount.preferences.defaultSensitive = checked + checked: root.account.preferences.defaultSensitive + onToggled: root.account.preferences.defaultSensitive = checked } FormCard.FormDelegateSeparator { @@ -175,8 +175,8 @@ Kirigami.Page { FormCard.FormSwitchDelegate { text: i18nc("@label Account preferences", "Include public posts in search results") - checked: AccountManager.selectedAccount.preferences.indexable - onToggled: AccountManager.selectedAccount.preferences.indexable = checked + checked: root.account.preferences.indexable + onToggled: root.account.preferences.indexable = checked } FormCard.FormDelegateSeparator { @@ -184,7 +184,7 @@ Kirigami.Page { FormCard.FormButtonDelegate { text: i18nc("@label Account preferences", "Default post language") - description: Qt.locale(AccountManager.selectedAccount.preferences.defaultLanguage).nativeLanguageName + description: Qt.locale(root.account.preferences.defaultLanguage).nativeLanguageName onClicked: languageSelect.createObject().open() @@ -194,10 +194,10 @@ Kirigami.Page { LanguageSelector { parent: root.QQC2.Overlay.overlay onAboutToShow: { - const sourceIndex = listView.model.sourceModel.indexOfValue(AccountManager.selectedAccount.preferences.defaultLanguage); + const sourceIndex = listView.model.sourceModel.indexOfValue(root.account.preferences.defaultLanguage); listView.currentIndex = listView.model.mapFromSource(sourceIndex).row; } - onCodeSelected: code => AccountManager.selectedAccount.preferences.defaultLanguage = code + onCodeSelected: code => root.account.preferences.defaultLanguage = code onClosed: destroyed() } } @@ -215,8 +215,8 @@ Kirigami.Page { i18nc("@item:inlistbox Default post visibility rule", "Unlisted"), i18nc("@item:inlistbox Default post visibility rule", "Private") ] - Component.onCompleted: currentIndex = AccountManager.selectedAccount.preferences.defaultVisibility - onCurrentValueChanged: AccountManager.selectedAccount.preferences.defaultVisibility = currentIndex + Component.onCompleted: currentIndex = root.account.preferences.defaultVisibility + onCurrentValueChanged: root.account.preferences.defaultVisibility = currentIndex } FormCard.FormDelegateSeparator { @@ -227,7 +227,7 @@ Kirigami.Page { id: websiteDelegate text: i18nc("@abel Account preferences", "Open Server in Browser") description: i18n("Some settings can only be configured on your server's website.") - onClicked: Qt.openUrlExternally(AccountManager.selectedAccount.instanceUri) + onClicked: Qt.openUrlExternally(root.account.instanceUri) } } } -- 2.30.2