Rename AccountStickerModel to AccountEmoticonModel
In preparation for using it for custom emojis as well
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user