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!
This commit is contained in:
Bryan Schumaker 2011-06-18 10:01:10 -04:00
parent 72f7ec90eb
commit 38f1d6ec8c
1 changed files with 1 additions and 3 deletions

View File

@ -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())