From 4b0831581a87db4eb4281d44990ae09f2454f01d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 4 Feb 2013 17:29:32 +0100 Subject: Use QTgaFile as translation context. Change-Id: I2042a031a3618a361cf3f98628978d3f2581baed Reviewed-by: Oswald Buddenhagen --- src/plugins/imageformats/tga/qtgafile.cpp | 20 ++++++++++---------- src/plugins/imageformats/tga/qtgafile.h | 3 +++ 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 #include +#include QT_BEGIN_NAMESPACE @@ -51,6 +52,8 @@ class QIODevice; class QTgaFile { + Q_DECLARE_TR_FUNCTIONS(QTgaFile) + public: enum Compression { NoCompression = 0, -- cgit v1.2.3