diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index 793f2d353b..554b104c34 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -125,7 +125,7 @@ class BooksModel(QAbstractTableModel): # {{{ def refresh_ondevice(self): self.db.refresh_ondevice() - self.refresh(reset=False) + self.resort() self.research() def set_book_on_device_func(self, func): diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index 98fd3a9fbc..470bbcdfa8 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -200,6 +200,11 @@ class CacheRow(list): # {{{ def __getslice__(self, i, j): return self.__getitem__(slice(i, j)) + def refresh_composites(self): + for c in self._composites: + self[c] = None + self._must_do = True + # }}} class ResultCache(SearchQueryParser): # {{{ @@ -918,6 +923,7 @@ class ResultCache(SearchQueryParser): # {{{ for item in self._data: if item is not None: item[ondevice_col] = db.book_on_device_string(item[0]) + item.refresh_composites() def refresh(self, db, field=None, ascending=True): temp = db.conn.get('SELECT * FROM meta2') diff --git a/src/calibre/manual/template_lang.rst b/src/calibre/manual/template_lang.rst index ec398b5d28..f1d2844d37 100644 --- a/src/calibre/manual/template_lang.rst +++ b/src/calibre/manual/template_lang.rst @@ -114,6 +114,8 @@ The syntax for using functions is ``{field:function(arguments)}``, or ``{field:f If you have programming experience, please note that the syntax in this mode (single function) is not what you might expect. Strings are not quoted. Spaces are significant. All arguments must be constants; there is no sub-evaluation. Use :ref:`template program mode ` and :ref:`general program mode ` to avoid these differences. +Many functions use regular expressions. In all cases, regular expression matching is case-insensitive. + The functions available are: * ``lowercase()`` -- return value of the field in lower case.