Rename AccountStickerModel to AccountEmoticonModel

In preparation for using it for custom emojis as well
This commit is contained in:
Tobias Fella
2023-05-20 22:43:31 +02:00
parent ee53793a6d
commit f2aa375b43
7 changed files with 62 additions and 58 deletions

View File

@@ -119,16 +119,16 @@ Kirigami.ScrollablePage {
enabled: !root.newSticker || (image.source && shortcode.text && description.text)
onClicked: {
if (root.newSticker) {
model.addSticker(image.source, shortcode.text, description.text)
model.addEmoticon(image.source, shortcode.text, description.text, "sticker")
} else {
if (description.text !== root.description) {
root.model.setStickerBody(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, description.text)
root.model.setEmoticonBody(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, description.text)
}
if (shortcode.text !== root.shortcode) {
root.model.setStickerShortcode(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, shortcode.text)
root.model.setEmoticonShortcode(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, shortcode.text)
}
if (image.source + "" !== root.url) {
root.model.setStickerImage(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, image.source)
root.model.setEmoticonImage(proxyModel.mapToSource(proxyModel.index(model.index, 0)).row, image.source)
}
}
root.closeDialog()

View File

@@ -30,7 +30,7 @@ Kirigami.ScrollablePage {
Repeater {
model: EmoticonFilterModel {
id: emoticonFilterModel
sourceModel: AccountStickerModel {
sourceModel: AccountEmoticonModel {
id: stickerModel
connection: Controller.activeConnection
}
@@ -84,7 +84,7 @@ Kirigami.ScrollablePage {
anchors.right: parent.right
anchors.margins: Kirigami.Units.smallSpacing
z: 2
onClicked: stickerModel.deleteSticker(emoticonFilterModel.mapToSource(emoticonFilterModel.index(model.index, 0)).row)
onClicked: stickerModel.deleteEmoticon(emoticonFilterModel.mapToSource(emoticonFilterModel.index(model.index, 0)).row)
}
}
}