summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2020-10-03 20:58:59 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-10-04 08:37:40 +0000
commit1cce99ccb1bcb0482e1b132ed634ad0f7ce2d251 (patch)
tree85b7a5abdfe9fbf37b46c721382c3e556cb598a9 /src
parent93ae5523192b6d636a32986d9cae10294bca5a83 (diff)
TGA Plugin: print error message when tga could not be load
When an image could not be loaded, the error message from QTgaFile was lost so the user could not find out why the load failed. Therefore print it out with qWarning(). Change-Id: I7ef7d8488ddd6c0c2be1d14caeb9ead528eb755f Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> (cherry picked from commit 8b48a7338d024cc8e41a52df7b2f0b4eb0e06280) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/imageformats/tga/qtgahandler.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/imageformats/tga/qtgahandler.cpp b/src/plugins/imageformats/tga/qtgahandler.cpp
index bc70f39..fbac735 100644
--- a/src/plugins/imageformats/tga/qtgahandler.cpp
+++ b/src/plugins/imageformats/tga/qtgahandler.cpp
@@ -66,6 +66,7 @@ bool QTgaHandler::canRead() const
setFormat("tga");
return true;
}
+ qWarning("QTgaHandler::canRead(): %s", qPrintable(tga->errorMessage()));
return false;
}
@@ -85,6 +86,8 @@ bool QTgaHandler::canRead(QIODevice *device)
{
QTgaFile tga(device);
isValid = tga.isValid();
+ if (!isValid)
+ qWarning("QTgaHandler::canRead(): %s", qPrintable(tga.errorMessage()));
}
device->seek(pos);
return isValid;