diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2020-10-03 20:58:59 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2020-10-04 10:21:47 +0200 |
commit | 8b48a7338d024cc8e41a52df7b2f0b4eb0e06280 (patch) | |
tree | b456c48c09184f214332fc10736d23f43cccd86b /src | |
parent | 2878f06e5bd75029f699ce1564144c3a83a8b00e (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
Pick-to: 5.15
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/imageformats/tga/qtgahandler.cpp | 3 |
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; |