Fix #1950899 [Renaming Saved seach to the same name displays a warning](https://bugs.launchpad.net/calibre/+bug/1950899)

This commit is contained in:
Kovid Goyal 2021-11-25 11:45:46 +05:30
parent c45ef9be71
commit f0cdd690ea
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1287,6 +1287,8 @@ class TagsModel(QAbstractItemModel): # {{{
_('Author names cannot contain & characters.'))
return False
if key == 'search':
if val == str(item.data(role) or ''):
return True
if val in self.db.saved_search_names():
return self.show_error_after_event_loop_tick(
_('Duplicate search name'), _('The saved search name %s is already used.')%val)