mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 17:37:36 +03:00
Don't add empty entries in hidden files editor with an empty string
or when cancel is clicked
This commit is contained in:
parent
eecb981736
commit
b058185d3b
1 changed files with 8 additions and 1 deletions
|
@ -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("]")) {
|
||||||
|
|
Loading…
Reference in a new issue