mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Implement refreshdb:
This commit is contained in:
parent
12cded043f
commit
67025df8ef
@ -112,10 +112,6 @@ Various things that require other things before they can be migrated:
|
|||||||
libraries/switching/on calibre startup.
|
libraries/switching/on calibre startup.
|
||||||
3. Port library/restore.py
|
3. Port library/restore.py
|
||||||
4. Replace the metadatabackup thread with the new implementation when using the new backend.
|
4. Replace the metadatabackup thread with the new implementation when using the new backend.
|
||||||
5. In the new API refresh() does not re-read from disk. That might break a
|
5. grep the sources for TODO
|
||||||
few things, for example content server reloading on db change as well as
|
6. Check that content server reloading on metadata,db change, metadata backup, refresh gui on calibredb add all work
|
||||||
dump/restore of db and the refreshdb: action in gui2/ui.py. Probaly you'll have to create a dedicated API for
|
|
||||||
refreshing the db from disk and change the code to use it instead of the overloaded refresh (which is often used
|
|
||||||
to reread data from the db after writing to it). See reload_from_db() in cache.py
|
|
||||||
6. grep the sources for TODO
|
|
||||||
'''
|
'''
|
||||||
|
@ -532,7 +532,12 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
|||||||
self.raise_()
|
self.raise_()
|
||||||
self.activateWindow()
|
self.activateWindow()
|
||||||
elif msg.startswith('refreshdb:'):
|
elif msg.startswith('refreshdb:'):
|
||||||
self.library_view.model().refresh()
|
db = self.library_view.model().db
|
||||||
|
if hasattr(db, 'new_api'):
|
||||||
|
db.new_api.reload_from_db()
|
||||||
|
self.library_view.model().resort()
|
||||||
|
else:
|
||||||
|
self.library_view.model().refresh()
|
||||||
self.library_view.model().research()
|
self.library_view.model().research()
|
||||||
self.tags_view.recount()
|
self.tags_view.recount()
|
||||||
self.library_view.model().db.refresh_format_cache()
|
self.library_view.model().db.refresh_format_cache()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user