From aa0726b20f398264f0a2abc60215be044b106f9c Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 17 May 2011 08:20:48 +0000 Subject: TQt4 port basket This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/basket@1232416 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- file-integration/basketthumbcreator.cpp | 44 ++++++++++++++++----------------- file-integration/basketthumbcreator.h | 6 ++--- 2 files changed, 25 insertions(+), 25 deletions(-) (limited to 'file-integration') diff --git a/file-integration/basketthumbcreator.cpp b/file-integration/basketthumbcreator.cpp index afad656..abc6e90 100644 --- a/file-integration/basketthumbcreator.cpp +++ b/file-integration/basketthumbcreator.cpp @@ -18,30 +18,30 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include "basketthumbcreator.h" -bool BasketThumbCreator::create(const QString &path, int /*width*/, int /*height*/, QImage &image) +bool BasketThumbCreator::create(const TQString &path, int /*width*/, int /*height*/, TQImage &image) { // Create the temporar folder: KTempDir tempDir; tempDir.setAutoDelete(true); - QString tempFolder = tempDir.name(); - QDir dir; + TQString tempFolder = tempDir.name(); + TQDir dir; dir.mkdir(tempFolder); - const Q_ULONG BUFFER_SIZE = 1024; + const TQ_ULONG BUFFER_SIZE = 1024; - QFile file(path); + TQFile file(path); if (file.open(IO_ReadOnly)) { - QTextStream stream(&file); - stream.setEncoding(QTextStream::Latin1); - QString line = stream.readLine(); + TQTextStream stream(&file); + stream.setEncoding(TQTextStream::Latin1); + TQString line = stream.readLine(); if (line != "BasKetNP:archive" && line != "BasKetNP:template") { file.close(); return false; @@ -49,9 +49,9 @@ bool BasketThumbCreator::create(const QString &path, int /*width*/, int /*height while (!stream.atEnd()) { // Get Key/Value Pair From the Line to Read: line = stream.readLine(); - int index = line.find(':'); - QString key; - QString value; + int index = line.tqfind(':'); + TQString key; + TQString value; if (index >= 0) { key = line.left(index); value = line.right(line.length() - index - 1); @@ -67,17 +67,17 @@ bool BasketThumbCreator::create(const QString &path, int /*width*/, int /*height return false; } // Get the preview file: - QFile previewFile(tempFolder + "preview.png"); + TQFile previewFile(tempFolder + "preview.png"); if (previewFile.open(IO_WriteOnly)) { char *buffer = new char[BUFFER_SIZE]; - Q_LONG sizeRead; - while ((sizeRead = file.readBlock(buffer, QMIN(BUFFER_SIZE, size))) > 0) { + TQ_LONG sizeRead; + while ((sizeRead = file.readBlock(buffer, TQMIN(BUFFER_SIZE, size))) > 0) { previewFile.writeBlock(buffer, sizeRead); size -= sizeRead; } previewFile.close(); delete buffer; - image = QImage(tempFolder + "preview.png"); + image = TQImage(tempFolder + "preview.png"); file.close(); return true; } @@ -91,8 +91,8 @@ bool BasketThumbCreator::create(const QString &path, int /*width*/, int /*height } // Get the archive file: char *buffer = new char[BUFFER_SIZE]; - Q_LONG sizeRead; - while ((sizeRead = file.readBlock(buffer, QMIN(BUFFER_SIZE, size))) > 0) { + TQ_LONG sizeRead; + while ((sizeRead = file.readBlock(buffer, TQMIN(BUFFER_SIZE, size))) > 0) { size -= sizeRead; } delete buffer; diff --git a/file-integration/basketthumbcreator.h b/file-integration/basketthumbcreator.h index 8a10cab..fe16b68 100644 --- a/file-integration/basketthumbcreator.h +++ b/file-integration/basketthumbcreator.h @@ -18,12 +18,12 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include -#include +#include +#include #include class BasketThumbCreator : public ThumbCreator { - bool create(const QString &path, int width, int height, QImage &image); + bool create(const TQString &path, int width, int height, TQImage &image); Flags flags() const; }; -- cgit v1.2.1