Speed up sorting when the book list is showing a restricted set of
books, such as when the results of a search are displayed or a virtual
library is used. Fixes#1217622 [calculated column sorts update the entire database while inside a Virtual Library](https://bugs.launchpad.net/calibre/+bug/1217622)
MOBI Output: Fix conversion of some super/sub scripts failling if they
are the first or last element in a paragraph. Fixes#1218858 [Subscripted text is generated by chance (MOBI)](https://bugs.launchpad.net/calibre/+bug/1218858)
Have the template used for the formats column when clicking the Formats
shortcut in the create columns dialog use approximate_formats() instead
of formats.
Prevent file type plugins that spin the event loop by displaying a
dialog from causing locking errors. The lock is now acquired only after
the file type plugin has run on import.
The sort keys for the sub-sorted columns are now only evaluated on demand.
The common case is that the keys from the first column will differ,
therefore we can speed up sorting on average by delaying evaluation of
the sort keys for the second and later columns, only evaluating them
when the sort keys of the first column for a particular book differ.
The gains will be particularly noticeable for columns where calculating
the sort key is expensive, like composite columns or the series column.
Fix a regression that could cause the dates in custom date-type columns
to change in some timezones when using th edit metadata dialog to make
unrelated changes. Fixes#1217096 [After updating metadata (i.e. new cover) home made date column (YYYY) is adjusted too](https://bugs.launchpad.net/calibre/+bug/1217096)
Merge branch 'master' of https://github.com/cbhaley/calibre
When replacing formats in a book with a very long title+authors on
windows, newdb could leave behind the old format file, because the
filename shortening algorithm has changed. Handle that case.
Creating a catalog with an already existing catalog in the library would
cause a temporary duplicate entry in the book list (the entry would go
away on restart. Also fix the author sort for catalogs generated in the
AZW3 format not being correct.