Remove signals in favor of direct function calls

pull/217/head
Joseph Donofry 5 years ago
parent 75cdc1eee2
commit 0078c72a37
No known key found for this signature in database
GPG Key ID: E8A1D78EF044B0CB
  1. 6
      resources/qml/Reactions.qml
  2. 3
      resources/qml/TimelineRow.qml
  3. 3
      resources/qml/TimelineView.qml
  4. 6
      resources/qml/emoji/EmojiPicker.qml

@ -5,8 +5,6 @@ import QtQuick.Controls 2.2
// adding new reactions via the emoji picker
Flow {
id: reactionFlow
// Signal for when a reaction is picked / unpicked
signal picked(string room_id, string event_id, string key, string selfReactedEvent)
// highlight colors for selfReactedEvent background
property real highlightHue: colors.highlight.hslHue
@ -36,7 +34,7 @@ Flow {
onClicked: {
console.debug("Picked " + model.key + "in response to " + reactionFlow.eventId + " in room " + reactionFlow.roomId + ". selfReactedEvent: " + model.selfReactedEvent)
reactionFlow.picked(reactionFlow.roomId, reactionFlow.eventId, model.key, model.selfReactedEvent)
timelineManager.reactToMessage(reactionFlow.roomId, reactionFlow.eventId, model.key, model.selfReactedEvent)
}
@ -57,7 +55,7 @@ Flow {
Text {
anchors.baseline: reactionCounter.baseline
id: reactionText
text: textMetrics.elidedText + (textMetrics.elidedText == textMetrics.text ? "" : "…")
text: textMetrics.elidedText + (textMetrics.elidedText == model.key ? "" : "…")
font.family: settings.emojiFont
color: reaction.hovered ? colors.highlight : colors.text
maximumLineCount: 1

@ -63,9 +63,6 @@ MouseArea {
reactions: model.reactions
roomId: model.roomId
eventId: model.id
Component.onCompleted: {
reactionRow.picked.connect(timelineManager.reactToMessage)
}
}
}

@ -33,9 +33,6 @@ Page {
model: EmojiProxyModel {
category: Emoji.Category.People
sourceModel: EmojiModel {}
}
Component.onCompleted: {
emojiPopup.picked.connect(timelineManager.queueReactionMessage)
}
}

@ -19,7 +19,6 @@ Popup {
emojiPopup.event_id = event_id
open()
}
signal picked(string room_id, string event_id, string key)
property string room_id
property string event_id
@ -42,8 +41,6 @@ Popup {
focus: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
onPicked: emojiPopup.close()
ColumnLayout {
id: columnView
anchors.fill: parent
@ -106,7 +103,8 @@ Popup {
// TODO: maybe add favorites at some point?
onClicked: {
console.debug("Picked " + model.unicode + "in response to " + emojiPopup.event_id + " in room " + emojiPopup.room_id)
emojiPopup.picked(emojiPopup.room_id, emojiPopup.event_id, model.unicode)
emojiPopup.close()
timelineManager.queueReactionMessage(emojiPopup.room_id, emojiPopup.event_id, model.unicode)
}
}

Loading…
Cancel
Save