mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Provide an error message when downloadig image from web fails.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
693bf249e4
commit
0f58510ce0
1 changed files with 3 additions and 1 deletions
|
@ -968,10 +968,12 @@ void DiveListView::loadImageFromURL(QUrl url)
|
||||||
|
|
||||||
QImage image = QImage();
|
QImage image = QImage();
|
||||||
image.loadFromData(imageData);
|
image.loadFromData(imageData);
|
||||||
if (image.isNull())
|
if (image.isNull()) {
|
||||||
// If this is not an image, maybe it's an html file and Miika can provide some xslr magic to extract images.
|
// If this is not an image, maybe it's an html file and Miika can provide some xslr magic to extract images.
|
||||||
// In this case we would call the function recursively on the list of image source urls;
|
// In this case we would call the function recursively on the list of image source urls;
|
||||||
|
MainWindow::instance()->getNotificationWidget()->showNotification(tr("%1 does not appear to be an image").arg(url.toString()), KMessageWidget::Error);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Since we already downloaded the image we can cache it as well.
|
// Since we already downloaded the image we can cache it as well.
|
||||||
QCryptographicHash hash(QCryptographicHash::Sha1);
|
QCryptographicHash hash(QCryptographicHash::Sha1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue