[gnome-music/wip/jfelder/artistalbumswidget-artist-property: 3/3] artistalbumswidget: Create artist GObject property
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/artistalbumswidget-artist-property: 3/3] artistalbumswidget: Create artist GObject property
- Date: Fri, 29 Jun 2018 11:48:30 +0000 (UTC)
commit 6d20d46b4317207c275b03710f91041cd227a51a
Author: Jean Felder <jfelder src gnome org>
Date: Fri Jun 22 16:10:01 2018 +0200
artistalbumswidget: Create artist GObject property
artist becomes a read-only GObject property corresponding to the
artist name.
This fixes a crash caused by commit 85066a19 (make artist variable
private).
Closes: #199
gnomemusic/views/artistsview.py | 2 +-
gnomemusic/widgets/artistalbumswidget.py | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/views/artistsview.py b/gnomemusic/views/artistsview.py
index beaf5c97..987cc78b 100644
--- a/gnomemusic/views/artistsview.py
+++ b/gnomemusic/views/artistsview.py
@@ -131,7 +131,7 @@ class ArtistsView(BaseView):
if widget:
artist_stack = self._artist_albums_stack
- if self.player.playing_playlist('Artist', widget.artist):
+ if self.player.playing_playlist('Artist', widget.props.artist):
self._artist_albums_widget = widget.get_parent()
GLib.idle_add(self._artist_albums_stack.set_visible_child,
self._artist_albums_widget)
diff --git a/gnomemusic/widgets/artistalbumswidget.py b/gnomemusic/widgets/artistalbumswidget.py
index a596ca24..f95ec2d6 100644
--- a/gnomemusic/widgets/artistalbumswidget.py
+++ b/gnomemusic/widgets/artistalbumswidget.py
@@ -146,7 +146,7 @@ class ArtistAlbumsWidget(Gtk.Box):
@log
def _update_model(self, player, playlist, current_iter):
- if not player.playing_playlist('Artist', self._artist):
+ if not player.playing_playlist('Artist', self.props.artist):
self._clean_model()
return False
@@ -208,3 +208,8 @@ class ArtistAlbumsWidget(Gtk.Box):
"""Deselect all items"""
for widget in self._widgets:
widget.select_none()
+
+ @GObject.Property(type=str, flags=GObject.ParamFlags.READABLE)
+ def artist(self):
+ """Artist name"""
+ return self._artist
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]