Forbid the use of empty strings as tags

Some tags were wrong when the user added two commas, so this patch forbids
the use of a comma when we don't have any tags.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-07-10 13:19:07 -03:00 committed by Dirk Hohndel
parent 892381b3ae
commit 37fa2fda03
2 changed files with 10 additions and 0 deletions

View file

@ -87,6 +87,8 @@ void GroupedLineEdit::addBlock(int start, int end)
block.start = start;
block.end = end;
block.text = text().mid(start, end - start + 1).remove(',').trimmed();
if (block.text.isEmpty())
return;
d->blocks.append(block);
viewport()->update();
}