changeset 89cc38a42e14 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=89cc38a42e14
description:
Do not log as error empty icon name
issue8584
review257981002
diffstat:
tryton/common/common.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (25 lines):
diff -r a5b56699a0d2 -r 89cc38a42e14 tryton/common/common.py
--- a/tryton/common/common.py Sun Aug 18 18:57:30 2019 +0200
+++ b/tryton/common/common.py Thu Aug 22 22:46:45 2019 +0200
@@ -113,6 +113,8 @@
@classmethod
def get_pixbuf(cls, iconname, size=16, color=None, badge=None):
+ if not iconname:
+ return
colors = CONFIG['icon.colors'].split(',')
cls.register_icon(iconname)
if iconname not in cls._pixbufs[(size, badge)]:
@@ -160,9 +162,10 @@
@classmethod
def get_image(cls, iconname, size=16, color=None, badge=None):
- pixbuf = cls.get_pixbuf(iconname, size, color, badge)
image = Gtk.Image()
- image.set_from_pixbuf(pixbuf)
+ if iconname:
+ pixbuf = cls.get_pixbuf(iconname, size, color, badge)
+ image.set_from_pixbuf(pixbuf)
return image