Merge from trunk

This commit is contained in:
Charles Haley 2010-09-26 19:22:17 +01:00
commit 2e8b8237e1
2 changed files with 2 additions and 11 deletions

View File

@ -565,9 +565,6 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, # {{{
mb = self.library_view.model().metadata_backup
if mb is not None:
mb.stop()
# give the thread time to stop so all operations complete
# otherwise the exit could kill the thread mid-write
time.sleep(2)
self.hide_windows()
self.emailer.stop()
@ -579,9 +576,9 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, # {{{
s.exit()
except:
pass
time.sleep(2)
except KeyboardInterrupt:
pass
time.sleep(2)
self.hide_windows()
return True

View File

@ -573,8 +573,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
The last step is clearing the indicator
'''
for book_id in book_ids:
if not self.data.has_id(book_id):
continue
self.conn.execute('DELETE FROM metadata_dirtied WHERE book=?',
(book_id,))
# if a later exception prevents the commit, then the dirtied
@ -588,9 +586,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
commit=True):
'''
Write metadata for each record to an individual OPF file
:param dump_to: None or list. If list then instead of writing to file,
data is append to list
'''
if book_ids is None:
book_ids = [x[0] for x in self.conn.get(
@ -611,7 +606,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
self.dirtied([book_id])
if commit:
self.conn.commit()
return True
def dirtied(self, book_ids, commit=True):
for book in book_ids:
@ -657,7 +651,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
except:
# This almost certainly means that the book has been deleted while
# the backup operation sat in the queue.
path,mi = (None, None)
path, mi = (None, None)
try:
# clear the dirtied indicator. The user must put it back if