Fix #740890 (Tag editor shouldn't add empty tags)

This commit is contained in:
Kovid Goyal 2011-03-23 08:25:03 -06:00
parent 5c06f567d9
commit a20d3a2ae8

View File

@ -122,6 +122,8 @@ class TagEditor(QDialog, Ui_TagEditor):
tags = unicode(self.add_tag_input.text()).split(',') tags = unicode(self.add_tag_input.text()).split(',')
for tag in tags: for tag in tags:
tag = tag.strip() tag = tag.strip()
if not tag:
continue
for item in self.available_tags.findItems(tag, Qt.MatchFixedString): for item in self.available_tags.findItems(tag, Qt.MatchFixedString):
self.available_tags.takeItem(self.available_tags.row(item)) self.available_tags.takeItem(self.available_tags.row(item))
if tag not in self.tags: if tag not in self.tags: