[gnome-music/wip/mschraal/async-queue: 23/25] artcache: Remove unneeded argument from DefaultIcon.get
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/async-queue: 23/25] artcache: Remove unneeded argument from DefaultIcon.get
- Date: Sat, 14 Aug 2021 23:20:24 +0000 (UTC)
commit c7f87a7b62a9c1e2e5358e488f7fbcd9065927f7
Author: Marinus Schraal <mschraal gnome org>
Date: Wed Aug 11 14:57:22 2021 +0200
artcache: Remove unneeded argument from DefaultIcon.get
The shape is directly related to the type of the art: artist or album.
Remove the argument from the getter.
gnomemusic/artcache.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/artcache.py b/gnomemusic/artcache.py
index ab1571c22..956ebd0ac 100644
--- a/gnomemusic/artcache.py
+++ b/gnomemusic/artcache.py
@@ -122,7 +122,7 @@ class DefaultIcon(GObject.GObject):
return icon_surface
- def get(self, icon_type, art_size, scale=1, round_shape=False):
+ def get(self, icon_type, art_size, scale=1):
"""Returns the requested symbolic icon
Returns a cairo surface of the requested symbolic icon in the
@@ -131,11 +131,15 @@ class DefaultIcon(GObject.GObject):
:param enum icon_type: The DefaultIcon.Type of the icon
:param enum art_size: The ArtSize requested
:param int scale: The scale
- :param bool round_shape: Indicates square or round icon shape
:return: The symbolic icon
:rtype: cairo.Surface
"""
+ if icon_type == DefaultIcon.Type.ALBUM:
+ round_shape = False
+ else:
+ round_shape = True
+
if (icon_type, art_size, scale) not in self._cache.keys():
new_icon = self._make_default_icon(
icon_type, art_size, scale, round_shape)
@@ -181,7 +185,7 @@ class ArtCache(GObject.GObject):
if isinstance(coreobject, CoreArtist):
self._default_icon = DefaultIcon().get(
- DefaultIcon.Type.ARTIST, self._size, self._scale, True)
+ DefaultIcon.Type.ARTIST, self._size, self._scale)
elif (isinstance(coreobject, CoreAlbum)
or isinstance(coreobject, CoreSong)):
self._default_icon = DefaultIcon().get(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]