Port away from implicitly defined onFoo properties in Connections

This commit is contained in:
Tobias Fella
2020-12-21 16:37:22 +01:00
parent 44da1ca1bf
commit b3899f1e69
3 changed files with 16 additions and 8 deletions

View File

@@ -111,7 +111,9 @@ RowLayout {
} }
Connections { Connections {
target: replyLoader.item target: replyLoader.item
onClicked: replyClicked(reply.eventId) function onClicked() {
replyClicked(reply.eventId)
}
} }
} }
RowLayout { RowLayout {

View File

@@ -72,7 +72,7 @@ Kirigami.ScrollablePage {
Connections { Connections {
target: Controller target: Controller
onErrorOccured: { function onErrorOccured(error, detail) {
inlineMessage.type = Kirigami.MessageType.Error; inlineMessage.type = Kirigami.MessageType.Error;
if (detail && detail.length !== 0) { if (detail && detail.length !== 0) {
inlineMessage.text = i18n("%1: %2", error, detail); inlineMessage.text = i18n("%1: %2", error, detail);

View File

@@ -209,7 +209,7 @@ Kirigami.ApplicationWindow {
Connections { Connections {
target: Controller target: Controller
onInitiated: { function onInitiated() {
if (Controller.accountCount === 0) { if (Controller.accountCount === 0) {
pageStack.replace("qrc:/imports/NeoChat/Page/LoginPage.qml", {}); pageStack.replace("qrc:/imports/NeoChat/Page/LoginPage.qml", {});
} else { } else {
@@ -218,24 +218,30 @@ Kirigami.ApplicationWindow {
} }
} }
onConnectionAdded: { function onConnectionAdded() {
if (Controller.accountCount === 1) { if (Controller.accountCount === 1) {
roomManager.roomList = pageStack.replace(roomListComponent); roomManager.roomList = pageStack.replace(roomListComponent);
} }
} }
onConnectionDropped: { function onConnectionDropped() {
if (Controller.accountCount === 0) { if (Controller.accountCount === 0) {
pageStack.clear(); pageStack.clear();
pageStack.replace("qrc:/imports/NeoChat/Page/LoginPage.qml"); pageStack.replace("qrc:/imports/NeoChat/Page/LoginPage.qml");
} }
} }
onGlobalErrorOccured: showPassiveNotification(error + ": " + detail) function onGlobalErrorOccured(error, detail) {
showPassiveNotification(error + ": " + detail)
}
onShowWindow: root.showWindow() function onShowWindow() {
root.showWindow()
}
onOpenRoom: roomManager.enterRoom(room) function onOpenRoom(room) {
roomManager.enterRoom(room)
}
} }
RoomListModel { RoomListModel {