Merge pull request #857 from Arakmar/hiddenFix

Don't add empty entries in hidden files editor with an empty string or when cancel is clicked
This commit is contained in:
Daniel Molkentin 2013-08-13 03:43:02 -07:00
commit f4da7f1fb0

View file

@ -101,7 +101,14 @@ void IgnoreListEditor::slotUpdateLocalIgnoreList()
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;
setupItemFlags(item);
if (pattern.startsWith("]")) {