mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 19:22:40 +02:00
Remove text from bool-decorated composite columns if that text results in a decoration.
This commit is contained in:
commit
139b24fb0d
1 changed files with 10 additions and 0 deletions
|
|
@ -646,6 +646,14 @@ def text_type(r, mult=False, idx=-1):
|
|||
return QVariant(', '.join(sorted(text.split('|'),key=sort_key)))
|
||||
return QVariant(text)
|
||||
|
||||
def decorated_text_type(r, mult=False, idx=-1):
|
||||
text = self.db.data[r][idx]
|
||||
if force_to_bool(text) is not None:
|
||||
return None
|
||||
if text and mult:
|
||||
return QVariant(', '.join(sorted(text.split('|'),key=sort_key)))
|
||||
return QVariant(text)
|
||||
|
||||
def number_type(r, idx=-1):
|
||||
return QVariant(self.db.data[r][idx])
|
||||
|
||||
|
|
@ -687,6 +695,8 @@ def number_type(r, idx=-1):
|
|||
self.dc[col] = functools.partial(text_type, idx=idx, mult=mult)
|
||||
if datatype in ['text', 'composite', 'enumeration'] and not mult:
|
||||
if self.custom_columns[col]['display'].get('use_decorations', False):
|
||||
self.dc[col] = functools.partial(decorated_text_type,
|
||||
idx=idx, mult=mult)
|
||||
self.dc_decorator[col] = functools.partial(
|
||||
bool_type_decorator, idx=idx,
|
||||
bool_cols_are_tristate=
|
||||
|
|
|
|||
Loading…
Reference in a new issue