Shutdown the metadata backup thread before running a db integrity check

This commit is contained in:
Kovid Goyal 2010-09-26 15:25:33 -06:00
parent c32128ef79
commit c63b551150
2 changed files with 8 additions and 2 deletions

View File

@ -72,7 +72,7 @@ class BooksModel(QAbstractTableModel): # {{{
'publisher' : _("Publisher"),
'tags' : _("Tags"),
'series' : _("Series"),
}
}
def __init__(self, parent=None, buffer=40):
QAbstractTableModel.__init__(self, parent)

View File

@ -106,8 +106,14 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
d.exec_()
def compact(self, *args):
d = CheckIntegrity(self.gui.library_view.model().db, self)
from calibre.library.caches import MetadataBackup
m = self.gui.library_view.model()
if m.metadata_backup is not None:
m.metadata_backup.stop()
d = CheckIntegrity(m.db, self)
d.exec_()
m.metadata_backup = MetadataBackup(m.db)
m.metadata_backup.start()
def open_config_dir(self, *args):
from calibre.utils.config import config_dir