fixing images not updating after items being deleted in middle

This commit is contained in:
Chris Cochrun 2022-09-28 11:12:47 -05:00
parent 893c32ea6f
commit cf15949347
2 changed files with 41 additions and 9 deletions

View file

@ -123,10 +123,10 @@ Item {
Layout.leftMargin: 20
Layout.rightMargin: 20
placeholderText: "Song Title..."
placeholderText: "Image Title..."
text: image.title
padding: 10
/* onEditingFinished: updateTitle(text); */
onEditingFinished: updateTitle(text);
}
Item {
@ -166,4 +166,16 @@ Item {
root.image = image;
print(image.filePath.toString());
}
function updateTitle(text) {
changeTitle(text, false);
imagesqlmodel.updateTitle(image.id, text);
showPassiveNotification(image.title);
}
function changeTitle(text, updateBox) {
if (updateBox)
imageTitleField.text = text;
image.title = text;
}
}