QML (coverItem): filenames can be None in the first execution
authorIvan Frade <ivan.frade@nokia.com>
Fri, 8 Apr 2011 15:54:45 +0000 (18:54 +0300)
committerIvan Frade <ivan.frade@nokia.com>
Fri, 8 Apr 2011 15:54:45 +0000 (18:54 +0300)
If reset is called in the state change, this reset will be called
the first time when the cover objects don't have any value in the vars.

src/qml/coverItem.py

index c73e4de..41b21fa 100644 (file)
@@ -29,11 +29,11 @@ class CoverItem (QtCore.QObject):
 
     def reset (self):
         cached_image = self._url
-        if os.path.exists (cached_image):
+        if cached_image and os.path.exists (cached_image):
             os.remove (cached_image)
             
         cached_thumb = self._thumb
-        if os.path.exists (cached_thumb):
+        if cached_thumb and os.path.exists (cached_thumb):
             os.remove (cached_thumb)
 
         self.url = self._initial_image