summaryrefslogtreecommitdiffstats
path: root/file-integration
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
commitaa0726b20f398264f0a2abc60215be044b106f9c (patch)
tree070fdbc19a1106cfdd7f651a8ce76bb1b89a513d /file-integration
parentd3cf5b3e75aadc3b02d0b56f030d4c3f8c2c749d (diff)
downloadbasket-aa0726b20f398264f0a2abc60215be044b106f9c.tar.gz
basket-aa0726b20f398264f0a2abc60215be044b106f9c.zip
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
Diffstat (limited to 'file-integration')
-rw-r--r--file-integration/basketthumbcreator.cpp44
-rw-r--r--file-integration/basketthumbcreator.h6
2 files changed, 25 insertions, 25 deletions
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 <qstringlist.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qtextstream.h>
+#include <tqstringlist.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqtextstream.h>
#include <ktempdir.h>
#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 <qstring.h>
-#include <qimage.h>
+#include <tqstring.h>
+#include <tqimage.h>
#include <kio/thumbcreator.h>
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;
};