From 38f1d6ec8cc31298f22f2187c42f608c552e1cda Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sat, 18 Jun 2011 10:01:10 -0400 Subject: [PATCH] ocarina: Only set album art once When we receive a new image, we should check if it is the same as the current image. If it is, we don't need to change anything! --- ocarina/body/image.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ocarina/body/image.py b/ocarina/body/image.py index 15ee8255..90b14a90 100644 --- a/ocarina/body/image.py +++ b/ocarina/body/image.py @@ -45,7 +45,7 @@ class FileImage(gtk.Image): return self.path def set_image(self, path, height): - if path != None: + if path != self.path: self.path = path self.height = height gtk.threads_enter() @@ -54,8 +54,6 @@ class FileImage(gtk.Image): gtk.threads_leave() def tooltip(self, image, x, y, keyboard, tip): - if self.path == None: - return image = gtk.Image() image.set_from_file(self.path) tip.set_icon(image.get_pixbuf())