mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix a regression in calibre 2.0 that caused setting the value of a custom number column to zero via the book list to clear the field instead. Fixes #1363076 [The number zero doesn't appear](https://bugs.launchpad.net/calibre/+bug/1363076)
This commit is contained in:
parent
8f18290228
commit
ed8459397a
@ -979,7 +979,10 @@ class BooksModel(QAbstractTableModel): # {{{
|
||||
val = 0 if val < 0 else 5 if val > 5 else val
|
||||
val *= 2
|
||||
elif typ in ('int', 'float'):
|
||||
val = unicode(value or '').strip()
|
||||
if value == 0:
|
||||
val = '0'
|
||||
else:
|
||||
val = unicode(value or '').strip()
|
||||
if not val:
|
||||
val = None
|
||||
elif typ == 'datetime':
|
||||
|
Loading…
x
Reference in New Issue
Block a user