Also auto increment series index when editing in table view

This commit is contained in:
Kovid Goyal 2009-12-24 14:50:56 -07:00
parent 418e392878
commit f1dfa30e30
3 changed files with 8 additions and 2 deletions

View File

@ -29,7 +29,7 @@ class LinuxFreeze(Command):
QTDIR = '/usr/lib/qt4' QTDIR = '/usr/lib/qt4'
QTDLLS = ('QtCore', 'QtGui', 'QtNetwork', 'QtSvg', 'QtXml', QTDLLS = ('QtCore', 'QtGui', 'QtNetwork', 'QtSvg', 'QtXml',
'QtWebKit', 'QtDBus') 'QtWebKit', 'QtDBus', 'QtXmlPatterns')
binary_excludes = ['libGLcore*', 'libGL*', 'libnvidia*'] binary_excludes = ['libGLcore*', 'libGL*', 'libnvidia*']

View File

@ -636,12 +636,16 @@ class BooksModel(QAbstractTableModel):
val *= 2 val *= 2
self.db.set_rating(id, val) self.db.set_rating(id, val)
elif column == 'series': elif column == 'series':
val = val.strip()
pat = re.compile(r'\[([.0-9]+)\]') pat = re.compile(r'\[([.0-9]+)\]')
match = pat.search(val) match = pat.search(val)
if match is not None: if match is not None:
self.db.set_series_index(id, float(match.group(1))) self.db.set_series_index(id, float(match.group(1)))
val = pat.sub('', val) val = pat.sub('', val)
val = val.strip() elif val:
ni = self.db.get_next_series_num_for(val)
if ni != 1:
self.db.set_series_index(id, ni)
if val: if val:
self.db.set_series(id, val) self.db.set_series(id, val)
elif column == 'timestamp': elif column == 'timestamp':

View File

@ -72,6 +72,8 @@ class RecipeInput(InputFormatPlugin):
if builtin: if builtin:
raw = get_builtin_recipe_by_title(title, log=log, raw = get_builtin_recipe_by_title(title, log=log,
download_recipe=False) download_recipe=False)
if raw is None:
raise ValueError('Failed to find builtin recipe: '+title)
recipe = compile_recipe(raw) recipe = compile_recipe(raw)