Commit 553f99db authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make sure that we don't cancel dialog

parent 0519ad90
Pipeline #70666 skipped
......@@ -267,14 +267,17 @@ void ImageWidget::changeUrl()
if (mReadOnly) {
return;
}
const QString path = QInputDialog::getText(this, i18n("Change image URL"), i18n("Image URL:"), QLineEdit::Normal, mPicture.url());
if (!path.isEmpty()) {
bool ok;
const QImage image = imageLoader()->loadImage(QUrl(path), &ok, false);
if (ok && !image.isNull()) {
mPicture.setUrl(path);
mHasImage = true;
updateView();
bool okPath = false;
const QString path = QInputDialog::getText(this, i18n("Change image URL"), i18n("Image URL:"), QLineEdit::Normal, mPicture.url(), &okPath);
if (okPath) {
if (!path.isEmpty()) {
bool ok;
const QImage image = imageLoader()->loadImage(QUrl(path), &ok, false);
if (ok && !image.isNull()) {
mPicture.setUrl(path);
mHasImage = true;
updateView();
}
}
}
}
......
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