summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-02-04 17:29:32 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-05 13:34:59 +0100
commit4b0831581a87db4eb4281d44990ae09f2454f01d (patch)
tree22e80575a9b674c9dff0e8ddb85cd0c3ce98d7b6
parent7a8e431a42a2865264e6d1889b3902a45752fc63 (diff)
Use QTgaFile as translation context.
Change-Id: I2042a031a3618a361cf3f98628978d3f2581baed Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r--src/plugins/imageformats/tga/qtgafile.cpp20
-rw-r--r--src/plugins/imageformats/tga/qtgafile.h3
2 files changed, 13 insertions, 10 deletions
diff --git a/src/plugins/imageformats/tga/qtgafile.cpp b/src/plugins/imageformats/tga/qtgafile.cpp
index 5d8e66a..740bcf1 100644
--- a/src/plugins/imageformats/tga/qtgafile.cpp
+++ b/src/plugins/imageformats/tga/qtgafile.cpp
@@ -133,57 +133,57 @@ QTgaFile::QTgaFile(QIODevice *device)
::memset(mHeader, 0, HeaderSize);
if (!mDevice->isReadable())
{
- mErrorMessage = QObject::tr("Could not read image data");
+ mErrorMessage = tr("Could not read image data");
return;
}
if (mDevice->isSequential())
{
- mErrorMessage = QObject::tr("Sequential device (eg socket) for image read not supported");
+ mErrorMessage = tr("Sequential device (eg socket) for image read not supported");
return;
}
if (!mDevice->seek(0))
{
- mErrorMessage = QObject::tr("Seek file/device for image read failed");
+ mErrorMessage = tr("Seek file/device for image read failed");
return;
}
int bytes = device->read((char*)mHeader, HeaderSize);
if (bytes != HeaderSize)
{
- mErrorMessage = QObject::tr("Image mHeader read failed");
+ mErrorMessage = tr("Image mHeader read failed");
return;
}
if (mHeader[ImageType] != 2)
{
// TODO: should support other image types
- mErrorMessage = QObject::tr("Image type not supported");
+ mErrorMessage = tr("Image type not supported");
return;
}
int bitsPerPixel = mHeader[PixelDepth];
bool validDepth = (bitsPerPixel == 16 || bitsPerPixel == 24 || bitsPerPixel == 32);
if (!validDepth)
{
- mErrorMessage = QObject::tr("Image dpeth not valid");
+ mErrorMessage = tr("Image dpeth not valid");
}
int curPos = mDevice->pos();
int fileBytes = mDevice->size();
if (!mDevice->seek(fileBytes - FooterSize))
{
- mErrorMessage = QObject::tr("Could not seek to image read footer");
+ mErrorMessage = tr("Could not seek to image read footer");
return;
}
char footer[FooterSize];
bytes = mDevice->read((char*)footer, FooterSize);
if (bytes != FooterSize)
{
- mErrorMessage = QObject::tr("Could not read footer");
+ mErrorMessage = tr("Could not read footer");
}
if (qstrncmp(&footer[SignatureOffset], "TRUEVISION-XFILE", 16) != 0)
{
- mErrorMessage = QObject::tr("Image type (non-TrueVision 2.0) not supported");
+ mErrorMessage = tr("Image type (non-TrueVision 2.0) not supported");
}
if (!mDevice->seek(curPos))
{
- mErrorMessage = QObject::tr("Could not reset to read data");
+ mErrorMessage = tr("Could not reset to read data");
}
}
diff --git a/src/plugins/imageformats/tga/qtgafile.h b/src/plugins/imageformats/tga/qtgafile.h
index a16bb3f..134532f 100644
--- a/src/plugins/imageformats/tga/qtgafile.h
+++ b/src/plugins/imageformats/tga/qtgafile.h
@@ -44,6 +44,7 @@
#include <QtGui/QColor>
#include <QtGui/QImage>
+#include <QtCore/QCoreApplication>
QT_BEGIN_NAMESPACE
@@ -51,6 +52,8 @@ class QIODevice;
class QTgaFile
{
+ Q_DECLARE_TR_FUNCTIONS(QTgaFile)
+
public:
enum Compression {
NoCompression = 0,