summaryrefslogtreecommitdiffstats
path: root/src/kvilib/file/kvi_file.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 18:31:12 +0000
commit0a80cfd57d271dd44221467efb426675fa470356 (patch)
tree6f503a31aa078eaf8fa015cf1749808529d49fc9 /src/kvilib/file/kvi_file.cpp
parent3329e5a804e28ef3f5eb51d1e7affdd5a508e8f2 (diff)
downloadkvirc-0a80cfd57d271dd44221467efb426675fa470356.tar.gz
kvirc-0a80cfd57d271dd44221467efb426675fa470356.zip
TQt4 port kvirc
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1238719 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kvilib/file/kvi_file.cpp')
-rw-r--r--src/kvilib/file/kvi_file.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/kvilib/file/kvi_file.cpp b/src/kvilib/file/kvi_file.cpp
index 8ab1e739..227a4997 100644
--- a/src/kvilib/file/kvi_file.cpp
+++ b/src/kvilib/file/kvi_file.cpp
@@ -30,12 +30,12 @@
KviFile::KviFile()
-: QFile()
+: TQFile()
{
}
-KviFile::KviFile(const QString &name)
-: QFile(name)
+KviFile::KviFile(const TQString &name)
+: TQFile(name)
{
}
@@ -46,7 +46,7 @@ KviFile::~KviFile()
bool KviFile::openForReading()
{
#ifdef COMPILE_USE_QT4
- return open(QFile::ReadOnly);
+ return open(TQFile::ReadOnly);
#else
return open(IO_ReadOnly);
#endif
@@ -55,41 +55,41 @@ bool KviFile::openForReading()
bool KviFile::openForWriting(bool bAppend)
{
#ifdef COMPILE_USE_QT4
- return open(QFile::WriteOnly | (bAppend ? QFile::Append : QFile::Truncate));
+ return open(TQFile::WriteOnly | (bAppend ? TQFile::Append : TQFile::Truncate));
#else
return open(IO_WriteOnly | (bAppend ? IO_Append : IO_Truncate));
#endif
}
-bool KviFile::save(const QByteArray &bData)
+bool KviFile::save(const TQByteArray &bData)
{
if(!save((kvi_u32_t)(bData.size())))return false;
return (writeBlock(bData.data(),bData.size()) == ((int)(bData.size())));
}
-bool KviFile::load(QByteArray &bData)
+bool KviFile::load(TQByteArray &bData)
{
kvi_u32_t iLen;
if(!load(iLen))return false;
- bData.resize(iLen); // it is automatically null terminated in Qt 4.x... BLEAH :D
+ bData.resize(iLen); // it is automatically null terminated in TQt 4.x... BLEAH :D
if(readBlock((char *)(bData.data()),iLen) != iLen)return false;
return true;
}
#ifndef COMPILE_USE_QT4
-bool KviFile::save(const KviQCString &szData)
+bool KviFile::save(const KviTQCString &szData)
{
if(!save((kvi_u32_t)(szData.length())))return false;
return (writeBlock(szData.data(),szData.length()) == ((int)(szData.length())));
}
-bool KviFile::load(KviQCString &szData)
+bool KviFile::load(KviTQCString &szData)
{
kvi_u32_t iLen;
if(!load(iLen))return false;
- szData.resize(iLen + 1); // this would allocate one extra byte with Qt 4.x...
+ szData.resize(iLen + 1); // this would allocate one extra byte with TQt 4.x...
if(readBlock((char *)(szData.data()),iLen) != iLen)return false;
*(szData.data() + iLen) = 0;
return true;
@@ -98,22 +98,22 @@ bool KviFile::load(KviQCString &szData)
#endif
-bool KviFile::save(const QString &szData)
+bool KviFile::save(const TQString &szData)
{
- KviQCString c = KviQString::toUtf8(szData);
+ KviTQCString c = KviTQString::toUtf8(szData);
if(!save((kvi_u32_t)(c.length())))return false;
return (writeBlock(c.data(),c.length()) == ((int)(c.length())));
}
-bool KviFile::load(QString &szData)
+bool KviFile::load(TQString &szData)
{
kvi_u32_t iLen;
if(!load(iLen))return false;
- KviQCString tmp;
+ KviTQCString tmp;
tmp.resize(iLen + 1);
if(readBlock((char *)(tmp.data()),iLen) != iLen)return false;
*(tmp.data() + iLen) = 0;
- szData = QString::fromUtf8(tmp.data());
+ szData = TQString::fromUtf8(tmp.data());
return true;
}