# HG changeset patch # User Goffi # Date 1583535949 -3600 # Node ID b5e6d36fbf9c5fbfc1272a87410db992f2641d1c # Parent 036ff0ed74744d68fbf8eacb10fdb3a1f9ad4679 chat: set AttachmentImageItem in python instead of kv: "source" is a StringProperty, and setting it in kv was in some case resulting in a "None" set, which was leading to a crash when Kivy cache was purged. It is now set in Python to avoid this problem. diff -r 036ff0ed7474 -r b5e6d36fbf9c cagou/plugins/plugin_wid_chat.kv --- a/cagou/plugins/plugin_wid_chat.kv Sun Mar 01 22:11:25 2020 +0100 +++ b/cagou/plugins/plugin_wid_chat.kv Sat Mar 07 00:05:49 2020 +0100 @@ -57,7 +57,6 @@ orientation: "vertical" SizedImage: id: image - source: root.data.get('preview') or root.data.get('path') or root.data.get('url') anim_delay: -1 diff -r 036ff0ed7474 -r b5e6d36fbf9c cagou/plugins/plugin_wid_chat.py --- a/cagou/plugins/plugin_wid_chat.py Sun Mar 01 22:11:25 2020 +0100 +++ b/cagou/plugins/plugin_wid_chat.py Sat Mar 07 00:05:49 2020 +0100 @@ -132,6 +132,11 @@ gallery = ImagesGallery(sources=[full_size_source]) G.host.showExtraUI(gallery) + def on_data(self, __, data): + source = data.get('preview') or data.get('path') or data.get('url') + if source: + self.source = source + class AttachmentImagesCollectionItem(ButtonBehavior, GridLayout): attachments = properties.ListProperty([])