1 # -*- coding: utf-8 -*-
4 from PySide import QtCore
5 from PySide import QtGui
6 from PySide import QtDeclarative
9 class CoverItem (QtCore.QObject):
11 def __init__ (self, image, initialImage=False, deleteAction=False):
12 QtCore.QObject.__init__(self)
13 self.initialImage = initialImage
14 self.deleteAction = deleteAction
20 def _setUrl (self, url):
22 self.url_changed.emit ()
24 def save (self, destination):
26 print " -> No changes"
30 print " -> Remove the album art"
31 if os.path.exists (destination):
32 os.remove (destination)
35 print " -> Saving:", self.url, "to", destination
36 os.rename (self.url, destination)
40 print "Removing", self.url
41 if os.path.exists (self.url):
45 url_changed = QtCore.Signal ()
46 url = QtCore.Property (unicode, _url, _setUrl, notify=url_changed)