summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2020-10-03 20:58:59 +0200
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2020-10-04 10:21:47 +0200
commit8b48a7338d024cc8e41a52df7b2f0b4eb0e06280 (patch)
treeb456c48c09184f214332fc10736d23f43cccd86b
parent2878f06e5bd75029f699ce1564144c3a83a8b00e (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>
-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;