Icon fixes

This commit is contained in:
Tim Bentley 2010-04-19 17:45:13 +01:00
parent 5a311c6f77
commit e463e83ed5
2 changed files with 8 additions and 3 deletions

View File

@ -362,6 +362,9 @@ class MediaManagerItem(QtGui.QWidget):
#if file updated rebuild icon #if file updated rebuild icon
if filedate > thumbdate: if filedate > thumbdate:
self.IconFromFile(file, thumb) self.IconFromFile(file, thumb)
if os.path.exists(file):
return True
return False
def IconFromFile(self, file, thumb): def IconFromFile(self, file, thumb):
icon = build_icon(unicode(file)) icon = build_icon(unicode(file))

View File

@ -124,8 +124,10 @@ class ImageMediaItem(MediaManagerItem):
(path, filename) = os.path.split(unicode(file)) (path, filename) = os.path.split(unicode(file))
thumb = os.path.join(self.servicePath, filename) thumb = os.path.join(self.servicePath, filename)
if os.path.exists(thumb): if os.path.exists(thumb):
self.validate(file, thumb) if self.validate(file, thumb):
icon = build_icon(thumb) icon = build_icon(thumb)
else:
icon = build_icon(u':/general/general_delete.png')
else: else:
icon = self.IconFromFile(file, thumb) icon = self.IconFromFile(file, thumb)
item_name = QtGui.QListWidgetItem(filename) item_name = QtGui.QListWidgetItem(filename)