Commit e7dbbb30 authored by David Jarvie's avatar David Jarvie

Fix inability to edit an existing calendar resource's configuration

parent d399161e
Pipeline #35870 passed with stage
in 15 minutes and 9 seconds
......@@ -167,20 +167,23 @@ void SingleFileResourceConfigDialog::setUrlValidation(QString (*func)(const QUrl
void SingleFileResourceConfigDialog::validate()
{
// Validate URL first, in order to display any error message.
const QUrl currentUrl = mUi->pathRequester->url();
if (mUi->pathRequester->text().trimmed().isEmpty() || currentUrl.isEmpty())
{
disableOkButton(QString());
return;
}
if (mUrlValidationFunc)
const QUrl currentUrl = mUi->pathRequester->url(); // empty if not creating
if (mCreating)
{
const QString error = (*mUrlValidationFunc)(currentUrl);
if (!error.isEmpty())
if (mUi->pathRequester->text().trimmed().isEmpty() || currentUrl.isEmpty())
{
disableOkButton(error, true);
disableOkButton(QString());
return;
}
if (mUrlValidationFunc)
{
const QString error = (*mUrlValidationFunc)(currentUrl);
if (!error.isEmpty())
{
disableOkButton(error, true);
return;
}
}
}
if (mUi->displayNameText->text().trimmed().isEmpty()
......
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