One thing I thought of was that at startup time, we need to do two sorts in order to ensure that the user gets a nice sort order for something like author. The best solution is probably be to remember two most recent sorts the user did and rerun them both when refreshing the book list. Another is to do an initial sort by path and then apply the remembered sort (since that at least gets a remembered author sort to sub-sort by title instead of coming up in whatever order the DB returned the entries).
Code:
--- src/calibre/library/database2.py 2009-03-04 17:46:47 +0000
+++ src/calibre/library/database2.py 2009-03-05 15:21:33 +0000
@@ -256,6 +256,7 @@
for r in temp:
self._data[r[0]] = r
self._map = [i[0] for i in self._data if i is not None]
+ self.sort('path', ascending)
if field is not None:
self.sort(field, ascending)
self._map_filtered = list(self._map)