EventDelegate: replace json() by dict() for debug
When debugging an event, `target.dict()` will return an object that can be properly worked with and pretty-printed using the `.j` command.
This commit is contained in:
parent
9c4d37f64b
commit
519eaa2ca0
2
TODO.md
2
TODO.md
@ -1,7 +1,5 @@
|
|||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
- improve debug
|
|
||||||
|
|
||||||
- handle invalid access token
|
- handle invalid access token
|
||||||
- If an account is gone from the user's config, discard UI state last page
|
- If an account is gone from the user's config, discard UI state last page
|
||||||
- filter > enter > room list is always scrolled to top
|
- filter > enter > room list is always scrolled to top
|
||||||
|
@ -146,7 +146,7 @@ HMenu {
|
|||||||
HMenuItem {
|
HMenuItem {
|
||||||
icon.name: "debug"
|
icon.name: "debug"
|
||||||
text: qsTr("Debug")
|
text: qsTr("Debug")
|
||||||
onTriggered: mainUI.debugConsole.toggle(eventDelegate, "t.json()")
|
onTriggered: mainUI.debugConsole.toggle(eventDelegate, ".j t.dict()")
|
||||||
}
|
}
|
||||||
|
|
||||||
HMenuItemPopupSpawner {
|
HMenuItemPopupSpawner {
|
||||||
|
@ -42,12 +42,12 @@ HColumnLayout {
|
|||||||
|
|
||||||
readonly property alias eventContent: eventContent
|
readonly property alias eventContent: eventContent
|
||||||
|
|
||||||
function json() {
|
|
||||||
let event = ModelStore.get(chat.userId, chat.roomId, "events")
|
function dict() {
|
||||||
.get(model.index)
|
let event = eventList.model.get(model.index)
|
||||||
event = JSON.parse(JSON.stringify(event))
|
event = JSON.parse(JSON.stringify(event))
|
||||||
event.source = JSON.parse(event.source)
|
event.source = JSON.parse(event.source)
|
||||||
return JSON.stringify(event, null, 4)
|
return event
|
||||||
}
|
}
|
||||||
|
|
||||||
function openContextMenu() {
|
function openContextMenu() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user