From 6eb8213f25d7984e12b6d1348d3cecb1ede5b7b9 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Wed, 25 Nov 2015 12:23:26 +0100 Subject: [PATCH 1/2] Preferences - Add your own columns: small improvement in the column type for ondevice --- src/calibre/gui2/preferences/columns.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/preferences/columns.py b/src/calibre/gui2/preferences/columns.py index 59a429bb94..804a1f0665 100644 --- a/src/calibre/gui2/preferences/columns.py +++ b/src/calibre/gui2/preferences/columns.py @@ -118,8 +118,10 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form): else: fm = field_metadata[col] - if col in ['title', 'ondevice']: + if col == 'title': coltype = _('Text') + elif col == 'ondevice': + coltype = _('Yes/No with text') else: dt = fm['datatype'] if fm['is_multiple']: From be9828997eea337bd3fbd8e0a52c3b249ac8a156 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Wed, 25 Nov 2015 12:23:50 +0100 Subject: [PATCH 2/2] Bug #1519599: search/replace on a custom series column resets the index. Kovid: as you can see the problem is in db.cache.set_field. I fixed it by using the custom series index if there is one. I don't think that this change has any undesirable side effects but I am not as familiar with the new db as I should be. --- src/calibre/db/cache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index b739beb989..c45dc428c6 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -1042,7 +1042,8 @@ class Cache(object): else: v = sid = None if name.startswith('#') and sid is None: - sid = 1.0 # The value will be set to 1.0 in the db table + extra = self.field_for(name + '_index', k) + sid = extra if extra else 1.0 # The value to be set the db link table bimap[k] = v if sid is not None: simap[k] = sid