Don't add empty entries in hidden files editor with an empty string

or when cancel is clicked
This commit is contained in:
Yoann Laissus 2013-08-12 13:04:00 +02:00
parent eecb981736
commit b058185d3b

View file

@ -101,7 +101,14 @@ void IgnoreListEditor::slotUpdateLocalIgnoreList()
void IgnoreListEditor::slotAddPattern() void IgnoreListEditor::slotAddPattern()
{ {
QString pattern = QInputDialog::getText(this, tr("Add Ignore Pattern"), tr("Add a new ignore pattern:")); bool okClicked;
QString pattern = QInputDialog::getText(this, tr("Add Ignore Pattern"),
tr("Add a new ignore pattern:"),
QLineEdit::Normal, QString(), &okClicked);
if (!okClicked || pattern.isEmpty())
return;
QListWidgetItem *item = new QListWidgetItem; QListWidgetItem *item = new QListWidgetItem;
setupItemFlags(item); setupItemFlags(item);
if (pattern.startsWith("]")) { if (pattern.startsWith("]")) {