diff options
author | Robert C. Helling <helling@atdotde.de> | 2017-01-11 10:50:52 +0100 |
---|---|---|
committer | Subsurface <dirk@subsurface-divelog.org> | 2017-01-11 05:43:14 -0800 |
commit | 0f58510ce0244513521296b75281fcc32f72a931 (patch) | |
tree | d35dd1dfcc361ea1f742bec05a899f8ea02d46fb /desktop-widgets/divelistview.cpp | |
parent | 693bf249e449365f099c6e3456f6462288fd54d6 (diff) | |
download | subsurface-0f58510ce0244513521296b75281fcc32f72a931.tar.gz |
Provide an error message when downloadig image from web fails.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'desktop-widgets/divelistview.cpp')
-rw-r--r-- | desktop-widgets/divelistview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/desktop-widgets/divelistview.cpp b/desktop-widgets/divelistview.cpp index 90ea3f5bd..34c021679 100644 --- a/desktop-widgets/divelistview.cpp +++ b/desktop-widgets/divelistview.cpp @@ -968,10 +968,12 @@ void DiveListView::loadImageFromURL(QUrl url) QImage image = QImage(); 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. // 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; + } // Since we already downloaded the image we can cache it as well. QCryptographicHash hash(QCryptographicHash::Sha1); |