mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Fix regression that broke import/export of bookmarks
Fixes #1231980 [Calibre ePub Viewer: Importing bookmarks does not work](https://bugs.launchpad.net/calibre/+bug/1231980)
This commit is contained in:
parent
7e84ed6ed5
commit
d1fb70cf32
@ -100,7 +100,7 @@ class BookmarkManager(QDialog, Ui_BookmarkManager):
|
||||
bad = False
|
||||
try:
|
||||
for bm in imported:
|
||||
if len(bm) != 2:
|
||||
if 'title' not in bm:
|
||||
bad = True
|
||||
break
|
||||
except:
|
||||
@ -109,9 +109,9 @@ class BookmarkManager(QDialog, Ui_BookmarkManager):
|
||||
if not bad:
|
||||
bookmarks = self.get_bookmarks()
|
||||
for bm in imported:
|
||||
if bm not in bookmarks and bm['title'] != 'calibre_current_page_bookmark':
|
||||
if bm not in bookmarks:
|
||||
bookmarks.append(bm)
|
||||
self.set_bookmarks(bookmarks)
|
||||
self.set_bookmarks([bm for bm in bookmarks if bm['title'] != 'calibre_current_page_bookmark'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
from PyQt4.Qt import QApplication
|
||||
|
Loading…
x
Reference in New Issue
Block a user