Sync to trunk.

This commit is contained in:
John Schember 2011-02-05 10:15:10 -05:00
commit 17206061f7
3 changed files with 15 additions and 3 deletions

View File

@ -951,8 +951,8 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
for w in getattr(self, 'custom_column_widgets', []):
self.books_to_refresh |= w.commit(self.id)
self.db.commit()
except IOError, err:
if err.errno == 13: # Permission denied
except (IOError, OSError) as err:
if getattr(err, 'errno', -1) == 13: # Permission denied
fname = err.filename if err.filename else 'file'
return error_dialog(self, _('Permission denied'),
_('Could not open %s. Is it being used by another'

View File

@ -791,6 +791,16 @@ class BooksModel(QAbstractTableModel): # {{{
val = qt_to_dt(val, as_utc=False)
elif typ == 'series':
val = unicode(value.toString()).strip()
if val:
pat = re.compile(r'\[([.0-9]+)\]')
match = pat.search(val)
if match is not None:
s_index = float(match.group(1))
val = pat.sub('', val).strip()
elif val:
if tweaks['series_index_auto_increment'] != 'const':
s_index = self.db.get_next_cc_series_num_for(val,
label=label, num=None)
elif typ == 'composite':
tmpl = unicode(value.toString()).strip()
disp = cc['display']

View File

@ -484,7 +484,9 @@ class CustomColumns(object):
if not existing:
existing = []
for x in set(set_val) - set(existing):
if x is None:
# normalized types are text and ratings, so we can do this check
# to see if we need to re-add the value
if not x:
continue
case_change = False
existing = list(self.all_custom(num=data['num']))