Fix renaming a user category to the same name it already has erases the
user category. Fixes #1207131 [Renaming a user category to the same name it already has erase this same user category](https://bugs.launchpad.net/calibre/+bug/1207131)
This commit is contained in:
Kovid Goyal 2013-08-01 07:47:05 +05:30
commit 340fda187c

View File

@ -971,6 +971,10 @@ class TagsModel(QAbstractItemModel): # {{{
else:
nkey = ckey[:dotpos+1] + val
nkey_lower = icu_lower(nkey)
if ckey == nkey:
return True
for c in sorted(user_cats.keys(), key=sort_key):
if icu_lower(c).startswith(ckey_lower):
if len(c) == len(ckey):