From 32293a7660fd7137f85ede46ef20b790b5c4cb84 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Jul 2010 10:39:46 -0600 Subject: [PATCH 1/3] ... --- src/calibre/manual/conversion.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/manual/conversion.rst b/src/calibre/manual/conversion.rst index 7df11575de..c8bc3ef665 100644 --- a/src/calibre/manual/conversion.rst +++ b/src/calibre/manual/conversion.rst @@ -349,7 +349,7 @@ table of contents, check the :guilabel:`Do not add detected chapters` option. If less than the :guilabel:`Chapter threshold` number of chapters were detected, |app| will then add any hyperlinks it finds in the input document to the Table of Contents. This often works well many input documents include a -hyperlinked Table of Contents right at the start. The :guilabel:`Number fo links` option can be used to control +hyperlinked Table of Contents right at the start. The :guilabel:`Number of links` option can be used to control this behavior. If set to zero, no links are added. If set to a number greater than zero, at most that number of links is added. From 3d524bf01d67357ed33427ed3ebcdeffd50a279a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Jul 2010 10:55:18 -0600 Subject: [PATCH 2/3] Fix migrate_preferences to allow downgrades --- src/calibre/library/database2.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index ad24b40d18..a96dc41a3c 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -145,14 +145,12 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): # Migrate saved search and user categories to db preference scheme def migrate_preference(name, default): - obsolete = '###OBSOLETE--DON\'T USE ME###' ans = self.prefs.get(name, None) if ans is None: ans = prefs[name] - if ans in (None, obsolete): + if ans is None: ans = default - prefs[name] = obsolete - self.prefs[name] = ans + prefs[name] = self.prefs[name] = ans migrate_preference('user_categories', {}) migrate_preference('saved_searches', {}) From 71996952ac765e1756608b74d410ae01adedf4d8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Jul 2010 10:56:09 -0600 Subject: [PATCH 3/3] ... --- src/calibre/library/database2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index a96dc41a3c..125a83c59a 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -150,7 +150,8 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns): ans = prefs[name] if ans is None: ans = default - prefs[name] = self.prefs[name] = ans + self.prefs[name] = ans + prefs[name] = default migrate_preference('user_categories', {}) migrate_preference('saved_searches', {})