mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 21:53:29 +02: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
1 changed files with 3 additions and 3 deletions
|
|
@ -100,7 +100,7 @@ def import_bookmarks(self):
|
|||
bad = False
|
||||
try:
|
||||
for bm in imported:
|
||||
if len(bm) != 2:
|
||||
if 'title' not in bm:
|
||||
bad = True
|
||||
break
|
||||
except:
|
||||
|
|
@ -109,9 +109,9 @@ def import_bookmarks(self):
|
|||
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…
Reference in a new issue