Comment 6 for bug 1733151

Revision history for this message
Charles Haley (cbhaley) wrote :

@kovid: the problem of a first saved search not showing is caused by the dynamic categories having been removed from field_metadata. 'search' is removed if there aren't any. Unfortunately, the dynamic categories are not recomputed when a saved search is added.

The problem is easily recreated.
1) delete all saved searches (or create a new library)
2) restart calibre
3) add a saved search using the button on the search line
4) you will see that the saved search category is not shown.
5) restart calibre. The category is now there.

I tried adding:
        self.current_db.new_api.initialize_dynamic()
after line 588 in gui2.search_box.py. This fixed the problem. I am telling you this way instead of submitting a patch because it isn't obvious to me that this is the right way to do the job. I am worried about side effects at the db level. You know much better than I do how that stuff works.