From 4bf725379af5b98e4403769abe608ea17dcd5bdb Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 19 May 2023 22:39:03 +0200 Subject: Fix adding duplicate stickers and strip file extension --- resources/qml/dialogs/ImagePackEditorDialog.qml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'resources/qml') diff --git a/resources/qml/dialogs/ImagePackEditorDialog.qml b/resources/qml/dialogs/ImagePackEditorDialog.qml index de516dd9..4f30e78a 100644 --- a/resources/qml/dialogs/ImagePackEditorDialog.qml +++ b/resources/qml/dialogs/ImagePackEditorDialog.qml @@ -255,8 +255,13 @@ ApplicationWindow { Layout.fillWidth: true Layout.columnSpan: 2 label: qsTr("Shortcode") - text: imagePack.data(imagePack.index(currentImageIndex, 0), SingleImagePackModel.ShortCode) - onTextEdited: imagePack.setData(imagePack.index(currentImageIndex, 0), text, SingleImagePackModel.ShortCode) + property int bindingCounter: 0 + text: bindingCounter, imagePack.data(imagePack.index(currentImageIndex, 0), SingleImagePackModel.ShortCode) + onTextEdited: { + imagePack.setData(imagePack.index(currentImageIndex, 0), text, SingleImagePackModel.ShortCode); + // force text field to update in case the model disagreed with the new value. + bindingCounter++; + } } MatrixTextField { -- cgit 1.5.1