[gnome-music/wip/mschraal/albumwidget-search-crash] albumwidget: Fix crash on switch back from search
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/albumwidget-search-crash] albumwidget: Fix crash on switch back from search
- Date: Fri, 18 Oct 2019 07:31:36 +0000 (UTC)
commit 247f474e156cba8c188232a11cac21db2906cc54
Author: Marinus Schraal <mschraal gnome org>
Date: Thu Oct 17 23:10:34 2019 +0200
albumwidget: Fix crash on switch back from search
When switching back from search view Music crashes, because it does not
receive the expected CoreAlbum from the 'album' property of AlbumWidget.
This is probably fall-out from the core rewrite: AlbumsView expects a
CoreAlbum, AlbumWidget supplies a Grl.Media.
Have the 'album' property return a CoreAlbum instead.
gnomemusic/widgets/albumwidget.py | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/widgets/albumwidget.py b/gnomemusic/widgets/albumwidget.py
index ac1c661a..3c298dff 100644
--- a/gnomemusic/widgets/albumwidget.py
+++ b/gnomemusic/widgets/albumwidget.py
@@ -44,7 +44,6 @@ class AlbumWidget(Gtk.EventBox):
"""
super().__init__()
- self._album = None
self._corealbum = None
self._duration_signal_id = None
self._model_signal_id = None
@@ -80,7 +79,6 @@ class AlbumWidget(Gtk.EventBox):
self._set_composer_label(corealbum)
- self._album = self._corealbum.props.media
self._album_model = self._corealbum.props.model
self._model_signal_id = self._album_model.connect_after(
"items-changed", self._on_model_items_changed)
@@ -183,11 +181,11 @@ class AlbumWidget(Gtk.EventBox):
self._listbox.select_none()
@GObject.Property(
- type=Grl.Media, default=False, flags=GObject.ParamFlags.READABLE)
+ type=Grl.Media, default=None, flags=GObject.ParamFlags.READABLE)
def album(self):
"""Get the current album.
:returns: the current album
- :rtype: Grl.Media
+ :rtype: CoreAlbum
"""
- return self._album
+ return self._corealbum
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]