This commit is contained in:
Kovid Goyal 2011-05-29 11:38:50 -06:00
commit ce7c994c34
3 changed files with 9 additions and 1 deletions

View File

@ -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):

View File

@ -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')

View File

@ -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 <template_mode>` and :ref:`general program mode <general_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.