Remove Controller::accountCount in favor of AccountRegistry::accountCount

This commit is contained in:
Tobias Fella
2023-09-02 23:32:33 +02:00
parent 3790955c56
commit b9d173d0b5
5 changed files with 5 additions and 21 deletions

View File

@@ -40,12 +40,12 @@ Labs.MenuBar {
Labs.MenuItem {
text: i18nc("menu", "New Private Chat…")
enabled: pageStack.layers.currentItem.title !== i18n("Start a Chat") && Controller.accountCount > 0
enabled: pageStack.layers.currentItem.title !== i18n("Start a Chat") && AccountRegistry.accountCount > 0
onTriggered: pushReplaceLayer("qrc:/StartChatPage.qml", {connection: Controller.activeConnection})
}
Labs.MenuItem {
text: i18nc("menu", "New Group…")
enabled: pageStack.layers.currentItem.title !== i18n("Start a Chat") && Controller.accountCount > 0
enabled: pageStack.layers.currentItem.title !== i18n("Start a Chat") && AccountRegistry.accountCount > 0
shortcut: StandardKey.New
onTriggered: {
const dialog = createRoomDialog.createObject(root.overlay)

View File

@@ -79,7 +79,7 @@ FormCard.FormCardPage {
Dialog.ConfirmLogout {
connection: model.connection
onAccepted: {
if (Controller.accountCount === 1) {
if (AccountRegistry.accountCount === 1) {
root.Window.window.close()
}
}

View File

@@ -236,7 +236,7 @@ Kirigami.ApplicationWindow {
target: Controller
function onInitiated() {
if (Controller.accountCount === 0) {
if (AccountRegistry.accountCount === 0) {
pageStack.replace("qrc:/WelcomePage.qml", {});
} else if (!roomListLoaded) {
pageStack.replace(roomListComponent, {