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:
committed by
Carl Schwan
parent
6439fa48f9
commit
5e80715898
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user