summaryrefslogtreecommitdiffstats
path: root/ktnef/lib
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /ktnef/lib
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ktnef/lib')
-rw-r--r--ktnef/lib/ktnefattach.cpp30
-rw-r--r--ktnef/lib/ktnefmessage.cpp24
-rw-r--r--ktnef/lib/ktnefparser.cpp130
-rw-r--r--ktnef/lib/ktnefproperty.cpp30
-rw-r--r--ktnef/lib/ktnefpropertyset.cpp54
-rw-r--r--ktnef/lib/ktnefwriter.cpp122
-rw-r--r--ktnef/lib/lzfu.cpp4
-rw-r--r--ktnef/lib/lzfu.h2
-rw-r--r--ktnef/lib/mapi.cpp22
-rw-r--r--ktnef/lib/mapi.h6
10 files changed, 212 insertions, 212 deletions
diff --git a/ktnef/lib/ktnefattach.cpp b/ktnef/lib/ktnefattach.cpp
index 76b1aeef0..b6dad60d6 100644
--- a/ktnef/lib/ktnefattach.cpp
+++ b/ktnef/lib/ktnefattach.cpp
@@ -25,12 +25,12 @@ public:
int size_;
int offset_;
int displaysize_;
- QString name_;
+ TQString name_;
int index_;
- QString filename_;
- QString displayname_;
- QString mimetag_;
- QString extension_;
+ TQString filename_;
+ TQString displayname_;
+ TQString mimetag_;
+ TQString extension_;
};
KTNEFAttach::KTNEFAttach()
@@ -90,10 +90,10 @@ int KTNEFAttach::displaySize() const
void KTNEFAttach::setDisplaySize(int s)
{ d->displaysize_ = s; }
-QString KTNEFAttach::name() const
+TQString KTNEFAttach::name() const
{ return d->name_; }
-void KTNEFAttach::setName(const QString& str)
+void KTNEFAttach::setName(const TQString& str)
{ setTitleParsed(); d->name_ = str; }
int KTNEFAttach::index() const
@@ -102,26 +102,26 @@ int KTNEFAttach::index() const
void KTNEFAttach::setIndex(int i)
{ setInfoParsed(); d->index_ = i; }
-QString KTNEFAttach::fileName() const
+TQString KTNEFAttach::fileName() const
{ return d->filename_; }
-void KTNEFAttach::setFileName(const QString& str)
+void KTNEFAttach::setFileName(const TQString& str)
{ d->filename_ = str; }
-QString KTNEFAttach::displayName() const
+TQString KTNEFAttach::displayName() const
{ return d->displayname_; }
-void KTNEFAttach::setDisplayName(const QString& str)
+void KTNEFAttach::setDisplayName(const TQString& str)
{ d->displayname_ = str; }
-QString KTNEFAttach::mimeTag() const
+TQString KTNEFAttach::mimeTag() const
{ return d->mimetag_; }
-void KTNEFAttach::setMimeTag(const QString& str)
+void KTNEFAttach::setMimeTag(const TQString& str)
{ d->mimetag_ = str; }
-QString KTNEFAttach::extension() const
+TQString KTNEFAttach::extension() const
{ return d->extension_; }
-void KTNEFAttach::setExtension(const QString& str)
+void KTNEFAttach::setExtension(const TQString& str)
{ d->extension_ = str; }
diff --git a/ktnef/lib/ktnefmessage.cpp b/ktnef/lib/ktnefmessage.cpp
index d94efb6c4..8f2648c3a 100644
--- a/ktnef/lib/ktnefmessage.cpp
+++ b/ktnef/lib/ktnefmessage.cpp
@@ -19,7 +19,7 @@
#include "ktnef/ktnefattach.h"
#include "lzfu.h"
-#include <qbuffer.h>
+#include <tqbuffer.h>
class KTNEFMessage::MessagePrivate
{
@@ -29,7 +29,7 @@ public:
attachments_.setAutoDelete( true );
}
- QPtrList<KTNEFAttach> attachments_;
+ TQPtrList<KTNEFAttach> attachments_;
};
KTNEFMessage::KTNEFMessage()
@@ -42,14 +42,14 @@ KTNEFMessage::~KTNEFMessage()
delete d;
}
-const QPtrList<KTNEFAttach>& KTNEFMessage::attachmentList() const
+const TQPtrList<KTNEFAttach>& KTNEFMessage::attachmentList() const
{
return d->attachments_;
}
-KTNEFAttach* KTNEFMessage::attachment( const QString& filename ) const
+KTNEFAttach* KTNEFMessage::attachment( const TQString& filename ) const
{
- QPtrListIterator<KTNEFAttach> it( d->attachments_ );
+ TQPtrListIterator<KTNEFAttach> it( d->attachments_ );
for ( ; it.current(); ++it )
if ( it.current()->name() == filename )
return it.current();
@@ -66,17 +66,17 @@ void KTNEFMessage::clearAttachments()
d->attachments_.clear();
}
-QString KTNEFMessage::rtfString()
+TQString KTNEFMessage::rtfString()
{
- QVariant prop = property( 0x1009 );
- if ( prop.isNull() || prop.type() != QVariant::ByteArray)
- return QString::null;
+ TQVariant prop = property( 0x1009 );
+ if ( prop.isNull() || prop.type() != TQVariant::ByteArray)
+ return TQString::null;
else
{
- QByteArray rtf;
- QBuffer input( prop.asByteArray() ), output( rtf );
+ TQByteArray rtf;
+ TQBuffer input( prop.asByteArray() ), output( rtf );
if ( input.open( IO_ReadOnly ) && output.open( IO_WriteOnly ) )
lzfu_decompress( &input, &output );
- return QString( rtf );
+ return TQString( rtf );
}
}
diff --git a/ktnef/lib/ktnefparser.cpp b/ktnef/lib/ktnefparser.cpp
index 0c9881400..e97ec8128 100644
--- a/ktnef/lib/ktnefparser.cpp
+++ b/ktnef/lib/ktnefparser.cpp
@@ -24,10 +24,10 @@
#include "ktnef/ktnefproperty.h"
#include "ktnef/ktnefmessage.h"
-#include <qdatetime.h>
-#include <qdatastream.h>
-#include <qfile.h>
-#include <qvariant.h>
+#include <tqdatetime.h>
+#include <tqdatastream.h>
+#include <tqfile.h>
+#include <tqvariant.h>
#include <kdebug.h>
#include <kmimetype.h>
#include <ksavefile.h>
@@ -42,23 +42,23 @@
typedef struct {
Q_UINT16 type;
Q_UINT16 tag;
- QVariant value;
+ TQVariant value;
struct {
Q_UINT32 type;
- QVariant value;
+ TQVariant value;
} name;
} MAPI_value;
void clearMAPIName( MAPI_value& mapi );
void clearMAPIValue(MAPI_value& mapi, bool clearName = true);
-QString readMAPIString( QDataStream& stream, bool isUnicode = false, bool align = true, int len = -1 );
-Q_UINT16 readMAPIValue(QDataStream& stream, MAPI_value& mapi);
-QDateTime readTNEFDate( QDataStream& stream );
-QString readTNEFAddress( QDataStream& stream );
-QByteArray readTNEFData( QDataStream& stream, Q_UINT32 len );
-QVariant readTNEFAttribute( QDataStream& stream, Q_UINT16 type, Q_UINT32 len );
-QDateTime formatTime( Q_UINT32 lowB, Q_UINT32 highB );
-QString formatRecipient( const QMap<int,KTNEFProperty*>& props );
+TQString readMAPIString( TQDataStream& stream, bool isUnicode = false, bool align = true, int len = -1 );
+Q_UINT16 readMAPIValue(TQDataStream& stream, MAPI_value& mapi);
+TQDateTime readTNEFDate( TQDataStream& stream );
+TQString readTNEFAddress( TQDataStream& stream );
+TQByteArray readTNEFData( TQDataStream& stream, Q_UINT32 len );
+TQVariant readTNEFAttribute( TQDataStream& stream, Q_UINT16 type, Q_UINT32 len );
+TQDateTime formatTime( Q_UINT32 lowB, Q_UINT32 highB );
+TQString formatRecipient( const TQMap<int,KTNEFProperty*>& props );
//------------------------------------------------------------------------------------
@@ -78,10 +78,10 @@ public:
delete message_;
}
- QDataStream stream_;
- QIODevice *device_;
+ TQDataStream stream_;
+ TQIODevice *device_;
bool deleteDevice_;
- QString defaultdir_;
+ TQString defaultdir_;
KTNEFAttach *current_;
KTNEFMessage *message_;
};
@@ -114,7 +114,7 @@ bool KTNEFParser::decodeMessage()
{
Q_UINT32 i1, i2, off;
Q_UINT16 u, tag, type;
- QVariant value;
+ TQVariant value;
// read (type+name)
d->stream_ >> i1;
@@ -162,7 +162,7 @@ bool KTNEFParser::decodeMessage()
readMAPIProperties( d->message_->properties(), 0 );
d->device_->at( i2 );
kdDebug() << "Properties: " << d->message_->properties().count() << endl;
- value = QString( "< %1 properties >" ).arg( d->message_->properties().count() - nProps );
+ value = TQString( "< %1 properties >" ).arg( d->message_->properties().count() - nProps );
}
break;
case attTNEFVERSION:
@@ -203,11 +203,11 @@ bool KTNEFParser::decodeMessage()
case attRECIPTABLE:
{
Q_UINT32 rows;
- QValueList<QVariant> recipTable;
+ TQValueList<TQVariant> recipTable;
d->stream_ >> rows;
for ( uint i=0; i<rows; i++ )
{
- QMap<int,KTNEFProperty*> props;
+ TQMap<int,KTNEFProperty*> props;
readMAPIProperties( props, 0 );
recipTable << formatRecipient( props );
}
@@ -256,8 +256,8 @@ bool KTNEFParser::decodeAttachment()
{
Q_UINT32 i;
Q_UINT16 tag, type, u;
- QVariant value;
- QString str;
+ TQVariant value;
+ TQString str;
d->stream_ >> i; // i <- attribute type & name
tag = ( i & 0x0000FFFF );
@@ -275,7 +275,7 @@ bool KTNEFParser::decodeAttachment()
d->current_->setSize( i );
d->current_->setOffset( d->device_->at() );
d->device_->at( d->device_->at() + i );
- value = QString( "< size=%1 >" ).arg( i );
+ value = TQString( "< size=%1 >" ).arg( i );
kdDebug() << "Attachment Data: size=" << i << endl;
break;
case attATTACHMENT: // try to get attachment info
@@ -292,7 +292,7 @@ bool KTNEFParser::decodeAttachment()
if ( !str.isEmpty() )
d->current_->setMimeTag( str );
d->current_->setExtension( d->current_->property( MAPI_TAG_EXTENSION ).toString() );
- value = QString( "< %1 properties >" ).arg( d->current_->properties().count() );
+ value = TQString( "< %1 properties >" ).arg( d->current_->properties().count() );
break;
case attATTACHMODDATE:
value = readTNEFDate( d->stream_ );
@@ -304,7 +304,7 @@ bool KTNEFParser::decodeAttachment()
break;
case attATTACHMETAFILE:
kdDebug() << "Attachment Metafile: size=" << i << endl;
- //value = QString( "< size=%1 >" ).arg( i );
+ //value = TQString( "< size=%1 >" ).arg( i );
//d->device_->at( d->device_->at()+i );
value = readTNEFData( d->stream_, i );
break;
@@ -321,7 +321,7 @@ bool KTNEFParser::decodeAttachment()
return true;
}
-void KTNEFParser::setDefaultExtractDir(const QString& dirname)
+void KTNEFParser::setDefaultExtractDir(const TQString& dirname)
{
d->defaultdir_ = dirname;
}
@@ -345,7 +345,7 @@ bool KTNEFParser::parseDevice()
}
d->stream_.setDevice( d->device_ );
- d->stream_.setByteOrder( QDataStream::LittleEndian );
+ d->stream_.setByteOrder( TQDataStream::LittleEndian );
d->stream_ >> i;
if (i == TNEF_SIGNATURE)
{
@@ -386,14 +386,14 @@ end: d->device_->close();
}
}
-bool KTNEFParser::extractFile(const QString& filename)
+bool KTNEFParser::extractFile(const TQString& filename)
{
KTNEFAttach *att = d->message_->attachment(filename);
if (!att) return false;
return extractAttachmentTo(att, d->defaultdir_);
}
-bool KTNEFParser::extractAttachmentTo(KTNEFAttach *att, const QString& dirname)
+bool KTNEFParser::extractAttachmentTo(KTNEFAttach *att, const TQString& dirname)
{
QString filename = dirname + "/" + att->name();
if (!d->device_->isOpen())
@@ -401,7 +401,7 @@ bool KTNEFParser::extractAttachmentTo(KTNEFAttach *att, const QString& dirname)
if (!d->device_->at(att->offset()))
return false;
KSaveFile saveFile( filename );
- QFile *outfile = saveFile.file();
+ TQFile *outfile = saveFile.file();
if ( !outfile )
return false;
@@ -428,13 +428,13 @@ bool KTNEFParser::extractAttachmentTo(KTNEFAttach *att, const QString& dirname)
bool KTNEFParser::extractAll()
{
- QPtrListIterator<KTNEFAttach> it(d->message_->attachmentList());
+ TQPtrListIterator<KTNEFAttach> it(d->message_->attachmentList());
for (;it.current();++it)
if (!extractAttachmentTo(it.current(),d->defaultdir_)) return false;
return true;
}
-bool KTNEFParser::extractFileTo(const QString& filename, const QString& dirname)
+bool KTNEFParser::extractFileTo(const TQString& filename, const TQString& dirname)
{
kdDebug() << "Extracting attachment: filename=" << filename << ", dir=" << dirname << endl;
KTNEFAttach *att = d->message_->attachment(filename);
@@ -442,17 +442,17 @@ bool KTNEFParser::extractFileTo(const QString& filename, const QString& dirname)
return extractAttachmentTo(att, dirname);
}
-bool KTNEFParser::openFile(const QString& filename)
+bool KTNEFParser::openFile(const TQString& filename)
{
deleteDevice();
delete d->message_;
d->message_ = new KTNEFMessage();
- d->device_ = new QFile( filename );
+ d->device_ = new TQFile( filename );
d->deleteDevice_ = true;
return parseDevice();
}
-bool KTNEFParser::openDevice( QIODevice *device )
+bool KTNEFParser::openDevice( TQIODevice *device )
{
deleteDevice();
d->device_ = device;
@@ -483,7 +483,7 @@ void KTNEFParser::checkCurrent( int key )
if ( mimetype->name() == "application/octet-stream" && d->current_->size() > 0 )
{
int oldOffset = d->device_->at();
- QByteArray buffer( QMIN( 32, d->current_->size() ) );
+ TQByteArray buffer( QMIN( 32, d->current_->size() ) );
d->device_->at( d->current_->offset() );
d->device_->readBlock( buffer.data(), buffer.size() );
mimetype = KMimeType::findByContent( buffer );
@@ -521,9 +521,9 @@ void clearMAPIValue(MAPI_value& mapi, bool clearName)
clearMAPIName( mapi );
}
-QDateTime formatTime( Q_UINT32 lowB, Q_UINT32 highB )
+TQDateTime formatTime( Q_UINT32 lowB, Q_UINT32 highB )
{
- QDateTime dt;
+ TQDateTime dt;
#if ( SIZEOF_UINT64_T == 8 )
uint64_t u64;
#elif ( SIZEOF_UNSIGNED_LONG_LONG == 8 )
@@ -550,10 +550,10 @@ QDateTime formatTime( Q_UINT32 lowB, Q_UINT32 highB )
return dt;
}
-QString formatRecipient( const QMap<int,KTNEFProperty*>& props )
+TQString formatRecipient( const TQMap<int,KTNEFProperty*>& props )
{
- QString s, dn, addr, t;
- QMap<int,KTNEFProperty*>::ConstIterator it;
+ TQString s, dn, addr, t;
+ TQMap<int,KTNEFProperty*>::ConstIterator it;
if ( ( it = props.find( 0x3001 ) ) != props.end() )
dn = ( *it )->valueString();
if ( ( it = props.find( 0x3003 ) ) != props.end() )
@@ -577,18 +577,18 @@ QString formatRecipient( const QMap<int,KTNEFProperty*>& props )
return s.stripWhiteSpace();
}
-QDateTime readTNEFDate( QDataStream& stream )
+TQDateTime readTNEFDate( TQDataStream& stream )
{
// 14-bytes long
Q_UINT16 y, m, d, hh, mm, ss, dm;
stream >> y >> m >> d >> hh >> mm >> ss >> dm;
- return QDateTime( QDate( y, m, d ), QTime( hh, mm, ss ) );
+ return TQDateTime( TQDate( y, m, d ), TQTime( hh, mm, ss ) );
}
-QString readTNEFAddress( QDataStream& stream )
+TQString readTNEFAddress( TQDataStream& stream )
{
Q_UINT16 totalLen, strLen, addrLen;
- QString s;
+ TQString s;
stream >> totalLen >> totalLen >> strLen >> addrLen;
s.append( readMAPIString( stream, false, false, strLen ) );
s.append( " <" );
@@ -600,15 +600,15 @@ QString readTNEFAddress( QDataStream& stream )
return s;
}
-QByteArray readTNEFData( QDataStream& stream, Q_UINT32 len )
+TQByteArray readTNEFData( TQDataStream& stream, Q_UINT32 len )
{
- QByteArray array( len );
+ TQByteArray array( len );
if ( len > 0 )
stream.readRawBytes( array.data(), len );
return array;
}
-QVariant readTNEFAttribute( QDataStream& stream, Q_UINT16 type, Q_UINT32 len )
+TQVariant readTNEFAttribute( TQDataStream& stream, Q_UINT16 type, Q_UINT32 len )
{
switch ( type )
{
@@ -622,7 +622,7 @@ QVariant readTNEFAttribute( QDataStream& stream, Q_UINT16 type, Q_UINT32 len )
}
}
-QString readMAPIString( QDataStream& stream, bool isUnicode, bool align, int len_ )
+TQString readMAPIString( TQDataStream& stream, bool isUnicode, bool align, int len_ )
{
Q_UINT32 len;
char *buf = 0;
@@ -638,16 +638,16 @@ QString readMAPIString( QDataStream& stream, bool isUnicode, bool align, int len
Q_UINT8 c;
for ( uint i=len; i<fullLen; i++ )
stream >> c;
- QString res;
+ TQString res;
if ( isUnicode )
- res = QString::fromUcs2( ( const unsigned short* )buf );
+ res = TQString::fromUcs2( ( const unsigned short* )buf );
else
- res = QString::fromLocal8Bit( buf );
+ res = TQString::fromLocal8Bit( buf );
delete [] buf;
return res;
}
-Q_UINT16 readMAPIValue(QDataStream& stream, MAPI_value& mapi)
+Q_UINT16 readMAPIValue(TQDataStream& stream, MAPI_value& mapi)
{
Q_UINT32 d;
@@ -669,11 +669,11 @@ Q_UINT16 readMAPIValue(QDataStream& stream, MAPI_value& mapi)
}
int n = 1;
- QVariant value;
+ TQVariant value;
if ( ISVECTOR( mapi ) )
{
stream >> n;
- mapi.value = QValueList<QVariant>();
+ mapi.value = TQValueList<TQVariant>();
}
for ( int i=0; i<n; i++ )
{
@@ -728,7 +728,7 @@ Q_UINT16 readMAPIValue(QDataStream& stream, MAPI_value& mapi)
value.clear();
Q_UINT32 len;
stream >> len;
- value = QByteArray( len );
+ value = TQByteArray( len );
if (len > 0)
{
int fullLen = len;
@@ -752,12 +752,12 @@ Q_UINT16 readMAPIValue(QDataStream& stream, MAPI_value& mapi)
return mapi.tag;
}
-bool KTNEFParser::readMAPIProperties( QMap<int,KTNEFProperty*>& props, KTNEFAttach *attach )
+bool KTNEFParser::readMAPIProperties( TQMap<int,KTNEFProperty*>& props, KTNEFAttach *attach )
{
Q_UINT32 n;
MAPI_value mapi;
KTNEFProperty *p;
- QMap<int,KTNEFProperty*>::ConstIterator it;
+ TQMap<int,KTNEFProperty*>::ConstIterator it;
bool foundAttachment = false;
// some initializations
@@ -788,7 +788,7 @@ bool KTNEFParser::readMAPIProperties( QMap<int,KTNEFProperty*>& props, KTNEFAtta
{
if ( mapi.type == MAPI_TYPE_OBJECT && attach )
{
- QByteArray data = mapi.value.toByteArray();
+ TQByteArray data = mapi.value.toByteArray();
int len = data.size();
ALIGN( len, 4 );
d->device_->at( d->device_->at()-len );
@@ -814,20 +814,20 @@ bool KTNEFParser::readMAPIProperties( QMap<int,KTNEFProperty*>& props, KTNEFAtta
ALIGN( len, 4 )
attach->setSize( len );
attach->setOffset( d->device_->at() - len );
- attach->addAttribute( attATTACHDATA, atpBYTE, QString( "< size=%1 >" ).arg( len ), false );
+ attach->addAttribute( attATTACHDATA, atpBYTE, TQString( "< size=%1 >" ).arg( len ), false );
}
}
kdDebug().form( "MAPI data: size=%d\n", mapi.value.toByteArray().size() );
break;
default:
{
- QString mapiname = "";
+ TQString mapiname = "";
if ( mapi.tag >= 0x8000 && mapi.tag <= 0xFFFE )
{
if ( mapi.name.type == 0 )
- mapiname = QString().sprintf( " [name = 0x%04x]", mapi.name.value.toUInt() );
+ mapiname = TQString().sprintf( " [name = 0x%04x]", mapi.name.value.toUInt() );
else
- mapiname = QString( " [name = %1]" ).arg( mapi.name.value.toString() );
+ mapiname = TQString( " [name = %1]" ).arg( mapi.name.value.toString() );
}
switch ( mapi.type & 0x0FFF )
{
@@ -867,7 +867,7 @@ bool KTNEFParser::readMAPIProperties( QMap<int,KTNEFProperty*>& props, KTNEFAtta
{
attach->setIndex( attach->property( MAPI_TAG_INDEX ).toUInt() );
attach->setDisplaySize( attach->property( MAPI_TAG_SIZE ).toUInt() );
- QString str = attach->property( MAPI_TAG_DISPLAYNAME ).toString();
+ TQString str = attach->property( MAPI_TAG_DISPLAYNAME ).toString();
if ( !str.isEmpty() )
attach->setDisplayName( str );
attach->setFileName( attach->property( MAPI_TAG_FILENAME ).toString() );
diff --git a/ktnef/lib/ktnefproperty.cpp b/ktnef/lib/ktnefproperty.cpp
index 3845b8d88..df04a388d 100644
--- a/ktnef/lib/ktnefproperty.cpp
+++ b/ktnef/lib/ktnefproperty.cpp
@@ -17,14 +17,14 @@
#include "ktnef/ktnefproperty.h"
#include "mapi.h"
-#include <qdatetime.h>
+#include <tqdatetime.h>
#include <ctype.h>
KTNEFProperty::KTNEFProperty()
{
}
-KTNEFProperty::KTNEFProperty( int key_, int type_, const QVariant& value_, const QVariant& name_ )
+KTNEFProperty::KTNEFProperty( int key_, int type_, const TQVariant& value_, const TQVariant& name_ )
: _key( key_ ), _type( type_ ), _value( value_ ), _name( name_ )
{
}
@@ -34,11 +34,11 @@ KTNEFProperty::KTNEFProperty( const KTNEFProperty& p )
{
}
-QString KTNEFProperty::keyString()
+TQString KTNEFProperty::keyString()
{
if ( _name.isValid() )
{
- if ( _name.type() == QVariant::String )
+ if ( _name.type() == TQVariant::String )
return _name.asString();
else
return mapiNamedTagString( _name.asUInt(), _key );
@@ -47,38 +47,38 @@ QString KTNEFProperty::keyString()
return mapiTagString( _key );
}
-QString KTNEFProperty::formatValue( const QVariant& value, bool beautify )
+TQString KTNEFProperty::formatValue( const TQVariant& value, bool beautify )
{
- if ( value.type() == QVariant::ByteArray )
+ if ( value.type() == TQVariant::ByteArray )
{
// check the first bytes (up to 8) if they are
// printable characters
- QByteArray arr = value.toByteArray();
+ TQByteArray arr = value.toByteArray();
bool printable = true;
for ( int i=QMIN( arr.size(), 8 )-1; i>=0 && printable; i-- )
printable = ( isprint( arr[ i ] ) != 0 );
if ( !printable )
{
- QString s;
+ TQString s;
uint i;
uint txtCount = beautify ? QMIN( arr.size(), 32 ) : arr.size();
for ( i=0; i < txtCount; ++i )
{
- s.append( QString().sprintf( "%02X", ( uchar )arr[ i ] ) );
+ s.append( TQString().sprintf( "%02X", ( uchar )arr[ i ] ) );
if( beautify )
s.append( " " );
}
if ( i < arr.size() )
- s.append( "... (size=" + QString::number( arr.size() ) + ")" );
+ s.append( "... (size=" + TQString::number( arr.size() ) + ")" );
return s;
}
}
- //else if ( value.type() == QVariant::DateTime )
+ //else if ( value.type() == TQVariant::DateTime )
// return value.toDateTime().toString();
return value.toString();
}
-QString KTNEFProperty::valueString()
+TQString KTNEFProperty::valueString()
{
return formatValue( _value );
}
@@ -89,11 +89,11 @@ int KTNEFProperty::key() const
int KTNEFProperty::type() const
{ return _type; }
-QVariant KTNEFProperty::value() const
+TQVariant KTNEFProperty::value() const
{ return _value; }
-QVariant KTNEFProperty::name() const
+TQVariant KTNEFProperty::name() const
{ return _name; }
bool KTNEFProperty::isVector() const
-{ return ( _value.type() == QVariant::List ); }
+{ return ( _value.type() == TQVariant::List ); }
diff --git a/ktnef/lib/ktnefpropertyset.cpp b/ktnef/lib/ktnefpropertyset.cpp
index cf35362fe..ec3ee2b51 100644
--- a/ktnef/lib/ktnefpropertyset.cpp
+++ b/ktnef/lib/ktnefpropertyset.cpp
@@ -28,9 +28,9 @@ KTNEFPropertySet::~KTNEFPropertySet()
clear( true );
}
-void KTNEFPropertySet::addProperty( int key, int type, const QVariant& value, const QVariant& name, bool overwrite )
+void KTNEFPropertySet::addProperty( int key, int type, const TQVariant& value, const TQVariant& name, bool overwrite )
{
- QMap<int,KTNEFProperty*>::ConstIterator it = properties_.find( key );
+ TQMap<int,KTNEFProperty*>::ConstIterator it = properties_.find( key );
if ( it != properties_.end() )
{
if ( overwrite )
@@ -43,9 +43,9 @@ void KTNEFPropertySet::addProperty( int key, int type, const QVariant& value, co
}
-QString KTNEFPropertySet::findProp(int key, const QString& fallback, bool upper)
+TQString KTNEFPropertySet::findProp(int key, const TQString& fallback, bool upper)
{
- QMap<int,KTNEFProperty*>::Iterator it = properties_.find( key );
+ TQMap<int,KTNEFProperty*>::Iterator it = properties_.find( key );
if( properties_.end() != it )
return upper ? KTNEFProperty::formatValue( (*it)->value(), false ).upper()
: KTNEFProperty::formatValue( (*it)->value(), false );
@@ -54,23 +54,23 @@ QString KTNEFPropertySet::findProp(int key, const QString& fallback, bool upper)
}
-QString KTNEFPropertySet::findNamedProp(const QString& name, const QString& fallback, bool upper)
+TQString KTNEFPropertySet::findNamedProp(const TQString& name, const TQString& fallback, bool upper)
{
- for ( QMap<int,KTNEFProperty*>::Iterator it = properties_.begin();
+ for ( TQMap<int,KTNEFProperty*>::Iterator it = properties_.begin();
it != properties_.end();
++it ){
if ( (*it)->name().isValid() ){
- QString s;
- if ( (*it)->name().type() == QVariant::String )
+ TQString s;
+ if ( (*it)->name().type() == TQVariant::String )
s = (*it)->name().asString();
else
- s = QString().sprintf( "0X%04X", (*it)->name().asUInt() );
+ s = TQString().sprintf( "0X%04X", (*it)->name().asUInt() );
if( s.upper() == name.upper() ){
- QVariant value = ( *it )->value();
- if( value.type() == QVariant::List ){
+ TQVariant value = ( *it )->value();
+ if( value.type() == TQVariant::List ){
s = "";
- for ( QValueList<QVariant>::ConstIterator lit = value.listBegin();
+ for ( TQValueList<TQVariant>::ConstIterator lit = value.listBegin();
lit != value.listEnd();
++lit ){
if( !s.isEmpty() )
@@ -88,21 +88,21 @@ QString KTNEFPropertySet::findNamedProp(const QString& name, const QString& fall
}
-QMap<int,KTNEFProperty*>& KTNEFPropertySet::properties()
+TQMap<int,KTNEFProperty*>& KTNEFPropertySet::properties()
{
return properties_;
}
-const QMap<int,KTNEFProperty*>& KTNEFPropertySet::properties() const
+const TQMap<int,KTNEFProperty*>& KTNEFPropertySet::properties() const
{
return properties_;
}
-QVariant KTNEFPropertySet::property( int key ) const
+TQVariant KTNEFPropertySet::property( int key ) const
{
- QMap<int,KTNEFProperty*>::ConstIterator it = properties_.find( key );
+ TQMap<int,KTNEFProperty*>::ConstIterator it = properties_.find( key );
if ( it == properties_.end() )
- return QVariant();
+ return TQVariant();
else
return ( *it )->value();
}
@@ -111,18 +111,18 @@ void KTNEFPropertySet::clear( bool deleteAll )
{
if ( deleteAll )
{
- for ( QMap<int,KTNEFProperty*>::ConstIterator it=properties_.begin(); it!=properties_.end(); ++it )
+ for ( TQMap<int,KTNEFProperty*>::ConstIterator it=properties_.begin(); it!=properties_.end(); ++it )
delete ( *it );
- for ( QMap<int,KTNEFProperty*>::ConstIterator it=attributes_.begin(); it!=attributes_.end(); ++it )
+ for ( TQMap<int,KTNEFProperty*>::ConstIterator it=attributes_.begin(); it!=attributes_.end(); ++it )
delete ( *it );
}
properties_.clear();
attributes_.clear();
}
-void KTNEFPropertySet::addAttribute( int key, int type, const QVariant& value, bool overwrite )
+void KTNEFPropertySet::addAttribute( int key, int type, const TQVariant& value, bool overwrite )
{
- QMap<int,KTNEFProperty*>::ConstIterator it = attributes_.find( key );
+ TQMap<int,KTNEFProperty*>::ConstIterator it = attributes_.find( key );
if ( it != attributes_.end() )
{
if ( overwrite )
@@ -130,25 +130,25 @@ void KTNEFPropertySet::addAttribute( int key, int type, const QVariant& value, b
else
return;
}
- KTNEFProperty *p = new KTNEFProperty( key, type, value, QVariant() );
+ KTNEFProperty *p = new KTNEFProperty( key, type, value, TQVariant() );
attributes_[ p->key() ] = p;
}
-QMap<int,KTNEFProperty*>& KTNEFPropertySet::attributes()
+TQMap<int,KTNEFProperty*>& KTNEFPropertySet::attributes()
{
return attributes_;
}
-const QMap<int,KTNEFProperty*>& KTNEFPropertySet::attributes() const
+const TQMap<int,KTNEFProperty*>& KTNEFPropertySet::attributes() const
{
return attributes_;
}
-QVariant KTNEFPropertySet::attribute( int key ) const
+TQVariant KTNEFPropertySet::attribute( int key ) const
{
- QMap<int,KTNEFProperty*>::ConstIterator it = attributes_.find( key );
+ TQMap<int,KTNEFProperty*>::ConstIterator it = attributes_.find( key );
if ( it == attributes_.end() )
- return QVariant();
+ return TQVariant();
else
return ( *it )->value();
}
diff --git a/ktnef/lib/ktnefwriter.cpp b/ktnef/lib/ktnefwriter.cpp
index ce35dbd20..48734bebd 100644
--- a/ktnef/lib/ktnefwriter.cpp
+++ b/ktnef/lib/ktnefwriter.cpp
@@ -23,9 +23,9 @@
#include "ktnef/ktnefproperty.h"
#include "ktnef/ktnefpropertyset.h"
-#include <qfile.h>
-#include <qdatetime.h>
-#include <qdatastream.h>
+#include <tqfile.h>
+#include <tqdatetime.h>
+#include <tqdatastream.h>
#include <kdebug.h>
#include <assert.h>
@@ -34,7 +34,7 @@
class KTNEFWriter::PrivateData {
public:
- PrivateData() { mFirstAttachNum = QDateTime::currentDateTime().toTime_t(); }
+ PrivateData() { mFirstAttachNum = TQDateTime::currentDateTime().toTime_t(); }
KTNEFPropertySet properties;
Q_UINT16 mFirstAttachNum;
@@ -46,16 +46,16 @@ KTNEFWriter::KTNEFWriter() {
// This is not something the user should fiddle with
// First set the TNEF version
- QVariant v(0x00010000);
+ TQVariant v(0x00010000);
addProperty( attTNEFVERSION, atpDWORD, v );
// Now set the code page to something reasonable. TODO: Use the right one
- QVariant v1( (Q_UINT32)0x4e4 );
- QVariant v2( (Q_UINT32)0x0 );
- QValueList<QVariant> list;
+ TQVariant v1( (Q_UINT32)0x4e4 );
+ TQVariant v2( (Q_UINT32)0x0 );
+ TQValueList<TQVariant> list;
list << v1;
list << v2;
- v = QVariant( list );
+ v = TQVariant( list );
addProperty( attOEMCODEPAGE, atpBYTE, list );
}
@@ -64,7 +64,7 @@ KTNEFWriter::~KTNEFWriter() {
}
-void KTNEFWriter::addProperty( int tag, int type, const QVariant& value ) {
+void KTNEFWriter::addProperty( int tag, int type, const TQVariant& value ) {
mData->properties.addProperty( tag, type, value );
}
@@ -76,13 +76,13 @@ void addToChecksum( Q_UINT32 i, Q_UINT16 &checksum ) {
checksum += (i >> 24) & 0xff;
}
-void addToChecksum( QCString &cs, Q_UINT16 &checksum ) {
+void addToChecksum( TQCString &cs, Q_UINT16 &checksum ) {
int len = cs.length();
for (int i=0; i<len; i++)
checksum += (Q_UINT8)cs[i];
}
-void writeCString( QDataStream &stream, QCString &str ) {
+void writeCString( TQDataStream &stream, TQCString &str ) {
stream.writeRawBytes( str.data(), str.length() );
stream << (Q_UINT8)0;
}
@@ -98,9 +98,9 @@ Q_UINT32 mergeTagAndType( Q_UINT32 tag, Q_UINT32 type ) {
*
* The checksum is a 16 byte int with all bytes in the data added.
*/
-bool KTNEFWriter::writeProperty( QDataStream &stream, int &bytes, int tag) {
- QMap<int,KTNEFProperty*>& properties = mData->properties.properties();
- QMap<int,KTNEFProperty*>::Iterator it = properties.find( tag );
+bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) {
+ TQMap<int,KTNEFProperty*>& properties = mData->properties.properties();
+ TQMap<int,KTNEFProperty*>::Iterator it = properties.find( tag );
if ( it == properties.end() )
return false;
@@ -109,12 +109,12 @@ bool KTNEFWriter::writeProperty( QDataStream &stream, int &bytes, int tag) {
Q_UINT32 i;
Q_UINT16 checksum = 0;
- QValueList<QVariant> list;
- QString s;
- QCString cs, cs2;
- QDateTime dt;
- QDate date;
- QTime time;
+ TQValueList<TQVariant> list;
+ TQString s;
+ TQCString cs, cs2;
+ TQDateTime dt;
+ TQDate date;
+ TQTime time;
switch( tag ) {
case attMSGSTATUS:
// Q_UINT8
@@ -192,12 +192,12 @@ bool KTNEFWriter::writeProperty( QDataStream &stream, int &bytes, int tag) {
break;
case attFROM:
- // 2 QString encoded to a TRP structure
+ // 2 TQString encoded to a TRP structure
list = property->value().toList();
assert( list.count() == 2 );
cs = list[0].toString().local8Bit(); // Name
- cs2 = (QString("smtp:") + list[1].toString()).local8Bit(); // Email address
+ cs2 = (TQString("smtp:") + list[1].toString()).local8Bit(); // Email address
i = 18 + cs.length() + cs2.length(); // 2 * sizof(TRP) + strings + 2x'\0'
stream << (Q_UINT8)LVL_MESSAGE;
@@ -301,17 +301,17 @@ bool KTNEFWriter::writeProperty( QDataStream &stream, int &bytes, int tag) {
}
-bool KTNEFWriter::writeFile( QIODevice &file ) {
+bool KTNEFWriter::writeFile( TQIODevice &file ) {
if ( !file.open( IO_WriteOnly ) )
return false;
- QDataStream stream( &file );
+ TQDataStream stream( &file );
return writeFile( stream );
}
-bool KTNEFWriter::writeFile( QDataStream &stream ) {
- stream.setByteOrder( QDataStream::LittleEndian );
+bool KTNEFWriter::writeFile( TQDataStream &stream ) {
+ stream.setByteOrder( TQDataStream::LittleEndian );
// Start by writing the opening TNEF stuff
stream << TNEF_SIGNATURE;
@@ -341,18 +341,18 @@ bool KTNEFWriter::writeFile( QDataStream &stream ) {
}
-void KTNEFWriter::setSender(const QString &name, const QString &email) {
+void KTNEFWriter::setSender(const TQString &name, const TQString &email) {
assert( !name.isEmpty() );
assert( !email.isEmpty() );
- QVariant v1( name );
- QVariant v2( email );
+ TQVariant v1( name );
+ TQVariant v2( email );
- QValueList<QVariant> list;
+ TQValueList<TQVariant> list;
list << v1;
list << v2;
- QVariant v( list );
+ TQVariant v( list );
addProperty( attFROM, 0, list ); // What's up with the 0 here ??
}
@@ -360,31 +360,31 @@ void KTNEFWriter::setMessageType(MessageType m) {
// Note that the MessageType list here is probably not long enough,
// more entries are most likely needed later
- QVariant v;
+ TQVariant v;
switch( m ) {
case Appointment:
- v = QVariant( QString( "IPM.Appointment" ) );
+ v = TQVariant( TQString( "IPM.Appointment" ) );
break;
case MeetingCancelled:
- v = QVariant( QString( "IPM.Schedule.Meeting.Cancelled" ) );
+ v = TQVariant( TQString( "IPM.Schedule.Meeting.Cancelled" ) );
break;
case MeetingRequest:
- v = QVariant( QString( "IPM.Schedule.Meeting.Request" ) );
+ v = TQVariant( TQString( "IPM.Schedule.Meeting.Request" ) );
break;
case MeetingNo:
- v = QVariant( QString( "IPM.Schedule.Meeting.Resp.Neg" ) );
+ v = TQVariant( TQString( "IPM.Schedule.Meeting.Resp.Neg" ) );
break;
case MeetingYes:
- v = QVariant( QString( "IPM.Schedule.Meeting.Resp.Pos" ) );
+ v = TQVariant( TQString( "IPM.Schedule.Meeting.Resp.Pos" ) );
break;
case MeetingTent:
// Tent?
- v = QVariant( QString( "IPM.Schedule.Meeting.Resp.Tent" ) );
+ v = TQVariant( TQString( "IPM.Schedule.Meeting.Resp.Tent" ) );
break;
default:
@@ -407,8 +407,8 @@ void KTNEFWriter::clearAttendees()
}
-void KTNEFWriter::addAttendee( const QString& /*cn*/, Role /*r*/, PartStat /*p*/,
- bool /*rsvp*/, const QString& /*mailto*/ )
+void KTNEFWriter::addAttendee( const TQString& /*cn*/, Role /*r*/, PartStat /*p*/,
+ bool /*rsvp*/, const TQString& /*mailto*/ )
{
}
@@ -416,16 +416,16 @@ void KTNEFWriter::addAttendee( const QString& /*cn*/, Role /*r*/, PartStat /*p*/
// I assume this is the same as the sender?
// U also assume that this is like "Name <address>"
-void KTNEFWriter::setOrganizer( const QString& organizer ) {
+void KTNEFWriter::setOrganizer( const TQString& organizer ) {
int i = organizer.find( '<' );
if ( i == -1 )
return;
- QString name = organizer.left( i );
+ TQString name = organizer.left( i );
name.stripWhiteSpace();
- QString email = organizer.right( i+1 );
+ TQString email = organizer.right( i+1 );
email = email.left( email.length()-1 );
email.stripWhiteSpace();
@@ -433,65 +433,65 @@ void KTNEFWriter::setOrganizer( const QString& organizer ) {
}
-void KTNEFWriter::setDtStart( const QDateTime& dtStart ) {
- QVariant v( dtStart );
+void KTNEFWriter::setDtStart( const TQDateTime& dtStart ) {
+ TQVariant v( dtStart );
addProperty( attDATESTART, atpDATE, v );
}
-void KTNEFWriter::setDtEnd( const QDateTime& dtEnd ) {
- QVariant v( dtEnd );
+void KTNEFWriter::setDtEnd( const TQDateTime& dtEnd ) {
+ TQVariant v( dtEnd );
addProperty( attDATEEND, atpDATE, v );
}
-void KTNEFWriter::setLocation( const QString& /*location*/ )
+void KTNEFWriter::setLocation( const TQString& /*location*/ )
{
}
-void KTNEFWriter::setUID( const QString& uid ) {
- QVariant v( uid );
+void KTNEFWriter::setUID( const TQString& uid ) {
+ TQVariant v( uid );
addProperty( attMSGID, atpSTRING, v );
}
// Date sent
-void KTNEFWriter::setDtStamp( const QDateTime& dtStamp ) {
- QVariant v( dtStamp );
+void KTNEFWriter::setDtStamp( const TQDateTime& dtStamp ) {
+ TQVariant v( dtStamp );
addProperty( attDATESENT, atpDATE, v );
}
-void KTNEFWriter::setCategories( const QStringList& )
+void KTNEFWriter::setCategories( const TQStringList& )
{
}
// I hope this is the body
-void KTNEFWriter::setDescription( const QString &body ) {
- QVariant v( body );
+void KTNEFWriter::setDescription( const TQString &body ) {
+ TQVariant v( body );
addProperty( attBODY, atpTEXT, v );
}
-void KTNEFWriter::setSummary( const QString &s ) {
- QVariant v( s );
+void KTNEFWriter::setSummary( const TQString &s ) {
+ TQVariant v( s );
addProperty( attSUBJECT, atpSTRING, v );
}
// TNEF encoding: Normal = 3, high = 2, low = 1
// MAPI encoding: Normal = -1, high = 0, low = 1
void KTNEFWriter::setPriority( Priority p ) {
- QVariant v( (Q_UINT32)p );
+ TQVariant v( (Q_UINT32)p );
addProperty( attMSGPRIORITY, atpSHORT, v );
}
-void KTNEFWriter::setAlarm( const QString& /*description*/, AlarmAction /*action*/,
- const QDateTime& /*wakeBefore*/ )
+void KTNEFWriter::setAlarm( const TQString& /*description*/, AlarmAction /*action*/,
+ const TQDateTime& /*wakeBefore*/ )
{
}
diff --git a/ktnef/lib/lzfu.cpp b/ktnef/lib/lzfu.cpp
index ab4fa36a0..cc66cbbbd 100644
--- a/ktnef/lib/lzfu.cpp
+++ b/ktnef/lib/lzfu.cpp
@@ -24,7 +24,7 @@
#endif
#include <sys/types.h>
#include <string.h>
-#include <qiodevice.h>
+#include <tqiodevice.h>
#include <stdio.h>
//#define DO_DEBUG
@@ -57,7 +57,7 @@ typedef struct _lzfuheader {
#define OFFSET(b) (b>>4)&0xFFF
#define LENGTH(b) ((b&0xF)+2)
-int lzfu_decompress(QIODevice *input, QIODevice *output)
+int lzfu_decompress(TQIODevice *input, TQIODevice *output)
{
unsigned char window[4096];
unsigned int wlength = 0, cursor = 0, ocursor = 0;
diff --git a/ktnef/lib/lzfu.h b/ktnef/lib/lzfu.h
index 4f8365586..25aa65d3c 100644
--- a/ktnef/lib/lzfu.h
+++ b/ktnef/lib/lzfu.h
@@ -20,6 +20,6 @@
class QIODevice;
-int lzfu_decompress( QIODevice *input, QIODevice *output );
+int lzfu_decompress( TQIODevice *input, TQIODevice *output );
#endif /* LZFU_H */
diff --git a/ktnef/lib/mapi.cpp b/ktnef/lib/mapi.cpp
index 8122153ce..bf84f1fd7 100644
--- a/ktnef/lib/mapi.cpp
+++ b/ktnef/lib/mapi.cpp
@@ -16,7 +16,7 @@
*/
#include "mapi.h"
-#include <qmap.h>
+#include <tqmap.h>
#include <klocale.h>
static struct
@@ -187,36 +187,36 @@ MAPI_NamedTagStrings[] =
{ 0x8560, I18N_NOOP( "Reminder Next Time" ) },
{ 0, 0 }
};
-static QMap<int,QString> MAPI_TagMap;
-static QMap<int,QString> MAPI_NamedTagMap;
+static TQMap<int,TQString> MAPI_TagMap;
+static TQMap<int,TQString> MAPI_NamedTagMap;
-QString mapiTagString( int key )
+TQString mapiTagString( int key )
{
if ( MAPI_TagMap.count() == 0 )
{
for ( int i=0; MAPI_TagStrings[ i ].str; i++ )
MAPI_TagMap[ MAPI_TagStrings[ i ].tag ] = i18n(MAPI_TagStrings[ i ].str);
}
- QMap<int,QString>::ConstIterator it = MAPI_TagMap.find( key );
+ TQMap<int,TQString>::ConstIterator it = MAPI_TagMap.find( key );
if ( it == MAPI_TagMap.end() )
- return QString().sprintf( "0x%04X", key );
+ return TQString().sprintf( "0x%04X", key );
else
- return QString().sprintf( "0x%04X ________: ", key ) + *it;
+ return TQString().sprintf( "0x%04X ________: ", key ) + *it;
}
-QString mapiNamedTagString( int key, int tag )
+TQString mapiNamedTagString( int key, int tag )
{
if ( MAPI_NamedTagMap.count() == 0 )
{
for ( int i=0; MAPI_NamedTagStrings[ i ].str; i++ )
MAPI_NamedTagMap[ MAPI_NamedTagStrings[ i ].tag ] = i18n(MAPI_NamedTagStrings[ i ].str);
}
- QMap<int,QString>::ConstIterator it = MAPI_NamedTagMap.find( key );
+ TQMap<int,TQString>::ConstIterator it = MAPI_NamedTagMap.find( key );
if ( it == MAPI_NamedTagMap.end() )
if ( tag >= 0 )
- return QString().sprintf( "0x%04X [0x%04X]: ", tag, key ) + *it;
+ return TQString().sprintf( "0x%04X [0x%04X]: ", tag, key ) + *it;
else
- return QString().sprintf( "0x%04X ________:", key ) + *it;
+ return TQString().sprintf( "0x%04X ________:", key ) + *it;
else
return *it;
}
diff --git a/ktnef/lib/mapi.h b/ktnef/lib/mapi.h
index fe4a37bf1..829f7d62f 100644
--- a/ktnef/lib/mapi.h
+++ b/ktnef/lib/mapi.h
@@ -18,9 +18,9 @@
#ifndef MAPI_H
#define MAPI_H
-#include <qstring.h>
+#include <tqstring.h>
-QString mapiTagString( int key );
-QString mapiNamedTagString( int key, int tag = -1 );
+TQString mapiTagString( int key );
+TQString mapiNamedTagString( int key, int tag = -1 );
#endif