[gnome-music/wip/mschraal/mrqmcq2u-debug-spew: 120/123] albumwidget: Bind ListModel early
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/mrqmcq2u-debug-spew: 120/123] albumwidget: Bind ListModel early
- Date: Mon, 27 Apr 2020 15:22:13 +0000 (UTC)
commit de1b797293d61bc1f1a276a7a9d279878ded7a75
Author: Marinus Schraal <mschraal gnome org>
Date: Sun Feb 16 21:01:45 2020 +0100
albumwidget: Bind ListModel early
If we start listening to ListModel items-changed signals before binding
the model to the ListBox, it might not yet be synced and crash in the
signal callback. The callback assumes the ListBox widgets are already
created and this might result in a crash.
Bind the ListBox widget before connecting the signal handler.
Closes: #367
gnomemusic/widgets/artistalbumwidget.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/widgets/artistalbumwidget.py b/gnomemusic/widgets/artistalbumwidget.py
index 9320abfa..f2c0feaa 100644
--- a/gnomemusic/widgets/artistalbumwidget.py
+++ b/gnomemusic/widgets/artistalbumwidget.py
@@ -85,10 +85,10 @@ class ArtistAlbumWidget(Gtk.Box):
if self._cover_size_group:
self._cover_size_group.add_widget(self._cover_stack)
- corealbum.props.model.connect_after(
- "items-changed", self._on_model_items_changed)
self._disc_list_box.bind_model(
corealbum.props.model, self._create_widget)
+ corealbum.props.model.connect_after(
+ "items-changed", self._on_model_items_changed)
corealbum.props.model.items_changed(0, 0, 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]