summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-05-19 22:39:03 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-05-20 00:57:51 +0200
commit4bf725379af5b98e4403769abe608ea17dcd5bdb (patch)
treef9eda3106167cbbef3cceefa5f6e110816c362ae /resources/qml
parentUse case folding instead of lower case for search (diff)
downloadnheko-4bf725379af5b98e4403769abe608ea17dcd5bdb.tar.xz
Fix adding duplicate stickers and strip file extension
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/dialogs/ImagePackEditorDialog.qml9
1 files changed, 7 insertions, 2 deletions
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 {