Cleanup connection handling in QML

Consistently pass connection objects to files that need them instead of randomly using Controller.activeConnection in some of them
This commit is contained in:
Tobias Fella
2023-09-12 17:10:16 +02:00
committed by Carl Schwan
parent 6439fa48f9
commit 5e80715898
37 changed files with 203 additions and 72 deletions

View File

@@ -46,6 +46,8 @@ QQC2.Control {
*/
property alias textField: textField
property NeoChatConnection connection
/**
* @brief The list of actions in the ChatBar.
*
@@ -414,6 +416,7 @@ QQC2.Control {
y: -height - 5
z: 1
chatDocumentHandler: documentHandler
connection: root.connection
Behavior on height {
NumberAnimation {
property: "height"

View File

@@ -36,6 +36,8 @@ ColumnLayout {
*/
required property NeoChatRoom currentRoom
required property NeoChatConnection connection
/**
* @brief A message has been sent from the chat bar.
*/
@@ -62,6 +64,8 @@ ColumnLayout {
ChatBar {
id: chatBar
connection: root.connection
visible: root.currentRoom.canSendEvent("m.room.message")
Layout.fillWidth: true

View File

@@ -17,11 +17,13 @@ QQC2.Popup {
id: root
width: parent.width
required property NeoChatConnection connection
visible: completions.count > 0
RoomListModel {
id: roomListModel
connection: Controller.activeConnection
connection: root.connection
}
property var chatDocumentHandler