Pull from trunk

This commit is contained in:
Kovid Goyal 2010-09-16 09:09:44 -06:00
commit 4fe321e41e
4 changed files with 14 additions and 8 deletions

View File

@ -35,7 +35,7 @@ class PRS505(USBMS):
VENDOR_NAME = 'SONY'
WINDOWS_MAIN_MEM = re.compile(
r'(PRS-(505|500))|'
r'(PRS-(505|500|300))|'
r'(PRS-((700[#/])|((6|9|3)(0|5)0&)))'
)
WINDOWS_CARD_A_MEM = re.compile(

View File

@ -72,10 +72,13 @@ class RescaleImages(object):
Qt.IgnoreAspectRatio, Qt.SmoothTransformation)
data = pixmap_to_data(img, format=ext)
else:
im = im.resize((int(new_width), int(new_height)), PILImage.ANTIALIAS)
of = cStringIO.StringIO()
im.convert('RGB').save(of, ext)
data = of.getvalue()
try:
im = im.resize((int(new_width), int(new_height)), PILImage.ANTIALIAS)
of = cStringIO.StringIO()
im.convert('RGB').save(of, ext)
data = of.getvalue()
except:
self.log.exception('Failed to rescale image')
if data is not None:
item.data = data
item.unload_data_from_memory()

View File

@ -1230,7 +1230,7 @@ class DeviceMixin(object): # {{{
self.location_manager.update_devices(cp, fs,
self.device_manager.device.icon)
# reset the views so that up-to-date info is shown. These need to be
# here because the sony driver updates collections in sync_booklists
# here because some drivers update collections in sync_booklists
self.memory_view.reset()
self.card_a_view.reset()
self.card_b_view.reset()
@ -1470,6 +1470,7 @@ class DeviceMixin(object): # {{{
if update_metadata:
if self.device_manager.is_device_connected:
self.device_manager.sync_booklists(None, booklists)
self.device_manager.sync_booklists(
Dispatcher(self.metadata_synced), booklists)
# }}}

View File

@ -1030,7 +1030,9 @@ class DeviceBooksModel(BooksModel): # {{{
def resort(self, reset=True):
if self.sorted_on:
self.sort(self.column_map.index(self.sorted_on[0]),
self.sorted_on[1], reset=reset)
self.sorted_on[1], reset=False)
if reset:
self.reset()
def columnCount(self, parent):
if parent and parent.isValid():