Fix undefined behavior when all users are logged out.
This commit is contained in:
parent
2a86fbd8b6
commit
d8c98374e4
|
@ -13,8 +13,8 @@ import Spectral.Setting 0.1
|
||||||
import SortFilterProxyModel 0.2
|
import SortFilterProxyModel 0.2
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property var controller: null
|
property var connection: null
|
||||||
readonly property var user: controller.connection ? controller.connection.localUser : null
|
readonly property var user: connection ? connection.localUser : null
|
||||||
|
|
||||||
property int filter: 0
|
property int filter: 0
|
||||||
property var enteredRoom: null
|
property var enteredRoom: null
|
||||||
|
@ -28,7 +28,7 @@ Item {
|
||||||
RoomListModel {
|
RoomListModel {
|
||||||
id: roomListModel
|
id: roomListModel
|
||||||
|
|
||||||
connection: controller.connection
|
connection: root.connection
|
||||||
|
|
||||||
onNewMessage: if (!window.active && MSettings.showNotification) spectralController.postNotification(roomId, eventId, roomName, senderName, text, icon)
|
onNewMessage: if (!window.active && MSettings.showNotification) spectralController.postNotification(roomId, eventId, roomName, senderName, text, icon)
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,7 +371,7 @@ ApplicationWindow {
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
controller: spectralController
|
connection: spectralController.connection
|
||||||
|
|
||||||
onLeaveRoom: roomForm.saveReadMarker(room)
|
onLeaveRoom: roomForm.saveReadMarker(room)
|
||||||
}
|
}
|
||||||
|
@ -420,7 +420,7 @@ ApplicationWindow {
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
spectralController.initiated.connect(function() {
|
spectralController.initiated.connect(function() {
|
||||||
if (spectralController.accountCount == 0) loginDialog.open()
|
if (spectralController.accountCount == 0) loginDialog.createObject(window).open()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,8 +60,6 @@ class Controller : public QObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
void setConnection(Connection* conn) {
|
void setConnection(Connection* conn) {
|
||||||
if (!conn)
|
|
||||||
return;
|
|
||||||
if (conn == m_connection)
|
if (conn == m_connection)
|
||||||
return;
|
return;
|
||||||
m_connection = conn;
|
m_connection = conn;
|
||||||
|
|
Loading…
Reference in New Issue