From b058185d3b9df37f28e4f99feadb68288ff2f480 Mon Sep 17 00:00:00 2001 From: Yoann Laissus Date: Mon, 12 Aug 2013 13:04:00 +0200 Subject: [PATCH] Don't add empty entries in hidden files editor with an empty string or when cancel is clicked --- src/mirall/ignorelisteditor.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/mirall/ignorelisteditor.cpp b/src/mirall/ignorelisteditor.cpp index 5d413f63a..a9606f7d8 100644 --- a/src/mirall/ignorelisteditor.cpp +++ b/src/mirall/ignorelisteditor.cpp @@ -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("]")) {