Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
path: root/linkbutton.py
diff options
authorManuel Quiñones <manuq@laptop.org>2012-03-29 14:44:18 (GMT)
committer Manuel Quiñones <manuq@laptop.org>2012-03-29 14:48:30 (GMT)
commite41c9532f06cff0aef843fe599c7b8328a3d21aa (patch)
tree507a4d46557a60f38c3c0980c17be278d07175bd /linkbutton.py
parent273cab7ffc0c0b4ae17d5844bc1d9c0fc06fef19 (diff)
Fix bookmarks read from previous session
Color parameter in get_image() method of class LinkButton is being passed with type str when inside a session, but is type unicode when read from a previous session, because json stores unicode. And Rsvg.Handle.new_from_data() needs a single byte string. This fixes #3402 . Also removed unused parameters in LinkButton constructor. Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Diffstat (limited to 'linkbutton.py')
1 files changed, 6 insertions, 1 deletions
diff --git a/linkbutton.py b/linkbutton.py
index 2804397..d1b4ea9 100644
--- a/linkbutton.py
+++ b/linkbutton.py
@@ -40,8 +40,13 @@ class LinkButton(TrayButton, GObject.GObject):
None, ([str])),
- def __init__(self, url, buf, color, title, owner, index, hash):
+ def __init__(self, buf, color, title, owner, hash):
+ # Color read from the Journal may be Unicode, but Rsvg needs
+ # it as single byte string:
+ if isinstance(color, unicode):
+ color = str(color)
self.set_image(buf, color.split(',')[1], color.split(',')[0])
self.hash = hash