Fix crash on service load of some people.

Fix loop on config exit under extreme activities!

bzr-revno: 1752
Fixes: https://launchpad.net/bugs/854171
This commit is contained in:
Tim Bentley 2011-09-20 17:11:49 +01:00
commit 3cec8cbb17
2 changed files with 5 additions and 1 deletions

View File

@ -185,7 +185,7 @@ def resize_image(image_path, width, height, background):
new_image = QtGui.QImage(width, height, new_image = QtGui.QImage(width, height,
QtGui.QImage.Format_ARGB32_Premultiplied) QtGui.QImage.Format_ARGB32_Premultiplied)
painter = QtGui.QPainter(new_image) painter = QtGui.QPainter(new_image)
painter.fillRect(new_image.rect(), background) painter.fillRect(new_image.rect(), QtGui.QColor(background))
painter.drawImage((width - realw) / 2, (height - realh) / 2, preview) painter.drawImage((width - realw) / 2, (height - realh) / 2, preview)
return new_image return new_image

View File

@ -215,6 +215,8 @@ class ImageManager(QtCore.QObject):
image = self._cache[name] image = self._cache[name]
if image.image is None: if image.image is None:
self._conversion_queue.modify_priority(image, Priority.High) self._conversion_queue.modify_priority(image, Priority.High)
# make sure we are running and if not give it a kick
self.process_updates()
while image.image is None: while image.image is None:
log.debug(u'get_image - waiting') log.debug(u'get_image - waiting')
time.sleep(0.1) time.sleep(0.1)
@ -235,6 +237,8 @@ class ImageManager(QtCore.QObject):
image = self._cache[name] image = self._cache[name]
if image.image_bytes is None: if image.image_bytes is None:
self._conversion_queue.modify_priority(image, Priority.Urgent) self._conversion_queue.modify_priority(image, Priority.Urgent)
# make sure we are running and if not give it a kick
self.process_updates()
while image.image_bytes is None: while image.image_bytes is None:
log.debug(u'get_image_bytes - waiting') log.debug(u'get_image_bytes - waiting')
time.sleep(0.1) time.sleep(0.1)