Port away from Controller::activeConnectionIndex

This commit is contained in:
Tobias Fella
2023-11-05 17:07:08 +01:00
committed by Joshua Goins
parent e9e1e223f7
commit 6ba2b715c3
3 changed files with 9 additions and 19 deletions

View File

@@ -160,8 +160,6 @@ RowLayout {
id: accounts
implicitHeight: contentHeight
currentIndex: Controller.activeConnectionIndex
header: Kirigami.Separator {}
footer: Delegates.RoundedItemDelegate {
@@ -227,6 +225,15 @@ RowLayout {
}
}
onVisibleChanged: {
for (let i = 0; i < accounts.count; i++) {
if (model.data(model.index(i, 0), Qt.DisplayRole) === root.connection.localUser.id) {
accounts.currentIndex = i;
break;
}
}
}
delegate: Delegates.RoundedItemDelegate {
id: userDelegate