Commit 61da56b9 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make sure that we don't cancel dialog

parent 2e07fe28
Pipeline #70651 skipped
......@@ -259,8 +259,10 @@ void CollectionDialog::Private::slotAddChildCollection()
{
const Akonadi::Collection parentCollection = mParent->selectedCollection();
if (canCreateCollection(parentCollection)) {
const QString name = QInputDialog::getText(mParent, i18nc("@title:window", "New Folder"), i18nc("@label:textbox, name of a thing", "Name"));
if (name.trimmed().isEmpty()) {
bool ok = false;
const QString name =
QInputDialog::getText(mParent, i18nc("@title:window", "New Folder"), i18nc("@label:textbox, name of a thing", "Name"), {}, {}, &ok);
if (name.trimmed().isEmpty() || !ok) {
return;
}
......
......@@ -736,11 +736,15 @@ public:
return;
}
bool ok = false;
QString name = QInputDialog::getText(parentWidget,
contextText(StandardActionManager::CreateCollection, StandardActionManager::DialogTitle),
contextText(StandardActionManager::CreateCollection, StandardActionManager::DialogText));
contextText(StandardActionManager::CreateCollection, StandardActionManager::DialogText),
{},
{},
&ok);
name = name.trimmed();
if (name.isEmpty()) {
if (name.isEmpty() || !ok) {
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment