Fix shortcuts in instanciators breaking on reload
When reloading the config file, the HShortcut within Instanciators (e.g. Rooms.AtIndex) were deleted then recreated. Except Shortcut happens to be an indestructible object type. Thus the old HShortcuts left alive were conflicting with the ones recreated, causing them to be called ambiguously. Loaders are destructible, so we wrap the shortcuts inside one to fix the issue.
This commit is contained in:
parent
3279a1befd
commit
61996400d0
|
@ -266,19 +266,23 @@ HListView {
|
||||||
|
|
||||||
Instantiator {
|
Instantiator {
|
||||||
model: Object.keys(window.settings.Keys.Accounts.AtIndex)
|
model: Object.keys(window.settings.Keys.Accounts.AtIndex)
|
||||||
delegate: HShortcut {
|
delegate: Loader {
|
||||||
|
sourceComponent: HShortcut {
|
||||||
sequences: window.settings.Keys.Accounts.AtIndex[modelData]
|
sequences: window.settings.Keys.Accounts.AtIndex[modelData]
|
||||||
onActivated: goToAccountNumber(parseInt(modelData, 10) - 1)
|
onActivated: goToAccountNumber(parseInt(modelData, 10) - 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Instantiator {
|
Instantiator {
|
||||||
model: Object.keys(window.settings.Keys.Rooms.AtIndex)
|
model: Object.keys(window.settings.Keys.Rooms.AtIndex)
|
||||||
delegate: HShortcut {
|
delegate: Loader {
|
||||||
|
sourceComponent: HShortcut {
|
||||||
sequences: window.settings.Keys.Rooms.AtIndex[modelData]
|
sequences: window.settings.Keys.Rooms.AtIndex[modelData]
|
||||||
onActivated: showAccountRoomAtIndex(parseInt(modelData, 10) - 1)
|
onActivated: showAccountRoomAtIndex(parseInt(modelData, 10) - 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
Loading…
Reference in New Issue
Block a user