summaryrefslogtreecommitdiffstats
path: root/ktnef/lib/ktnefwriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ktnef/lib/ktnefwriter.cpp')
-rw-r--r--ktnef/lib/ktnefwriter.cpp122
1 files changed, 61 insertions, 61 deletions
diff --git a/ktnef/lib/ktnefwriter.cpp b/ktnef/lib/ktnefwriter.cpp
index 48734bebd..3da4dc1e0 100644
--- a/ktnef/lib/ktnefwriter.cpp
+++ b/ktnef/lib/ktnefwriter.cpp
@@ -34,10 +34,10 @@
class KTNEFWriter::PrivateData {
public:
- PrivateData() { mFirstAttachNum = TQDateTime::currentDateTime().toTime_t(); }
+ PrivateData() { mFirstAttachNum = TQDateTime::tqcurrentDateTime().toTime_t(); }
KTNEFPropertySet properties;
- Q_UINT16 mFirstAttachNum;
+ TQ_UINT16 mFirstAttachNum;
};
@@ -50,8 +50,8 @@ KTNEFWriter::KTNEFWriter() {
addProperty( attTNEFVERSION, atpDWORD, v );
// Now set the code page to something reasonable. TODO: Use the right one
- TQVariant v1( (Q_UINT32)0x4e4 );
- TQVariant v2( (Q_UINT32)0x0 );
+ TQVariant v1( (TQ_UINT32)0x4e4 );
+ TQVariant v2( (TQ_UINT32)0x0 );
TQValueList<TQVariant> list;
list << v1;
list << v2;
@@ -69,25 +69,25 @@ void KTNEFWriter::addProperty( int tag, int type, const TQVariant& value ) {
}
-void addToChecksum( Q_UINT32 i, Q_UINT16 &checksum ) {
+void addToChecksum( TQ_UINT32 i, TQ_UINT16 &checksum ) {
checksum += i & 0xff;
checksum += (i >> 8) & 0xff;
checksum += (i >> 16) & 0xff;
checksum += (i >> 24) & 0xff;
}
-void addToChecksum( TQCString &cs, Q_UINT16 &checksum ) {
+void addToChecksum( TQCString &cs, TQ_UINT16 &checksum ) {
int len = cs.length();
for (int i=0; i<len; i++)
- checksum += (Q_UINT8)cs[i];
+ checksum += (TQ_UINT8)cs[i];
}
void writeCString( TQDataStream &stream, TQCString &str ) {
stream.writeRawBytes( str.data(), str.length() );
- stream << (Q_UINT8)0;
+ stream << (TQ_UINT8)0;
}
-Q_UINT32 mergeTagAndType( Q_UINT32 tag, Q_UINT32 type ) {
+TQ_UINT32 mergeTagAndType( TQ_UINT32 tag, TQ_UINT32 type ) {
return ( ( type & 0xffff ) << 16 ) | ( tag & 0xffff );
}
@@ -107,8 +107,8 @@ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) {
KTNEFProperty *property = *it;
- Q_UINT32 i;
- Q_UINT16 checksum = 0;
+ TQ_UINT32 i;
+ TQ_UINT16 checksum = 0;
TQValueList<TQVariant> list;
TQString s;
TQCString cs, cs2;
@@ -117,60 +117,60 @@ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) {
TQTime time;
switch( tag ) {
case attMSGSTATUS:
- // Q_UINT8
+ // TQ_UINT8
i = property->value().toUInt() & 0xff;
checksum = i;
- stream << (Q_UINT8)LVL_MESSAGE;
+ stream << (TQ_UINT8)LVL_MESSAGE;
stream << mergeTagAndType( tag, property->type() );
- stream << (Q_UINT32)1;
- stream << (Q_UINT8)i;
+ stream << (TQ_UINT32)1;
+ stream << (TQ_UINT8)i;
bytes += 10;
break;
case attMSGPRIORITY:
case attREQUESTRES:
- // Q_UINT16
+ // TQ_UINT16
i = property->value().toUInt() & 0xffff;
addToChecksum( i, checksum );
- stream << (Q_UINT8)LVL_MESSAGE;
+ stream << (TQ_UINT8)LVL_MESSAGE;
stream << mergeTagAndType( tag, property->type() );
- stream << (Q_UINT32)2;
- stream << (Q_UINT16)i;
+ stream << (TQ_UINT32)2;
+ stream << (TQ_UINT16)i;
bytes += 11;
break;
case attTNEFVERSION:
- // Q_UINT32
+ // TQ_UINT32
i = property->value().toUInt();
addToChecksum( i, checksum );
- stream << (Q_UINT8)LVL_MESSAGE;
+ stream << (TQ_UINT8)LVL_MESSAGE;
stream << mergeTagAndType( tag, property->type() );
- stream << (Q_UINT32)4;
- stream << (Q_UINT32)i;
+ stream << (TQ_UINT32)4;
+ stream << (TQ_UINT32)i;
bytes += 13;
break;
case attOEMCODEPAGE:
- // 2 Q_UINT32
+ // 2 TQ_UINT32
list = property->value().toList();
assert( list.count() == 2 );
- stream << (Q_UINT8)LVL_MESSAGE;
+ stream << (TQ_UINT8)LVL_MESSAGE;
stream << mergeTagAndType( tag, property->type() );
- stream << (Q_UINT32)8;
+ stream << (TQ_UINT32)8;
i = list[0].toInt();
addToChecksum( i, checksum );
- stream << (Q_UINT32)i;
+ stream << (TQ_UINT32)i;
i = list[1].toInt();
addToChecksum( i, checksum );
- stream << (Q_UINT32)i;
+ stream << (TQ_UINT32)i;
bytes += 17;
break;
@@ -183,9 +183,9 @@ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) {
cs = property->value().toString().local8Bit();
addToChecksum( cs, checksum );
- stream << (Q_UINT8)LVL_MESSAGE;
+ stream << (TQ_UINT8)LVL_MESSAGE;
stream << mergeTagAndType( tag, property->type() );
- stream << (Q_UINT32)cs.length()+1;
+ stream << (TQ_UINT32)cs.length()+1;
writeCString( stream, cs );
bytes += 9 + cs.length()+1;
@@ -200,18 +200,18 @@ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) {
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;
+ stream << (TQ_UINT8)LVL_MESSAGE;
stream << mergeTagAndType( tag, property->type() );
- stream << (Q_UINT32)i;
+ stream << (TQ_UINT32)i;
// The stream has to be aligned to 4 bytes for the strings
// TODO: Or does it? Looks like Outlook doesn't do this
// bytes += 17;
// Write the first TRP structure
- stream << (Q_UINT16)4; // trpidOneOff
- stream << (Q_UINT16)i; // totalsize
- stream << (Q_UINT16)(cs.length()+1); // sizeof name
- stream << (Q_UINT16)(cs2.length()+1); // sizeof address
+ stream << (TQ_UINT16)4; // trpidOneOff
+ stream << (TQ_UINT16)i; // totalsize
+ stream << (TQ_UINT16)(cs.length()+1); // sizeof name
+ stream << (TQ_UINT16)(cs2.length()+1); // sizeof address
// if ( bytes % 4 != 0 )
// Align the buffer
@@ -221,7 +221,7 @@ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) {
writeCString( stream, cs2 );
// Write the empty padding TRP structure (just zeroes)
- stream << (Q_UINT32)0 << (Q_UINT32)0;
+ stream << (TQ_UINT32)0 << (TQ_UINT32)0;
addToChecksum( 4, checksum );
addToChecksum( i, checksum );
@@ -241,37 +241,37 @@ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) {
time = dt.time();
date = dt.date();
- stream << (Q_UINT8)LVL_MESSAGE;
+ stream << (TQ_UINT8)LVL_MESSAGE;
stream << mergeTagAndType( tag, property->type() );
- stream << (Q_UINT32)14;
+ stream << (TQ_UINT32)14;
- i = (Q_UINT16)date.year();
+ i = (TQ_UINT16)date.year();
addToChecksum( i, checksum );
- stream << (Q_UINT16)i;
- i = (Q_UINT16)date.month();
+ stream << (TQ_UINT16)i;
+ i = (TQ_UINT16)date.month();
addToChecksum( i, checksum );
- stream << (Q_UINT16)i;
- i = (Q_UINT16)date.day();
+ stream << (TQ_UINT16)i;
+ i = (TQ_UINT16)date.day();
addToChecksum( i, checksum );
- stream << (Q_UINT16)i;
- i = (Q_UINT16)time.hour();
+ stream << (TQ_UINT16)i;
+ i = (TQ_UINT16)time.hour();
addToChecksum( i, checksum );
- stream << (Q_UINT16)i;
- i = (Q_UINT16)time.minute();
+ stream << (TQ_UINT16)i;
+ i = (TQ_UINT16)time.minute();
addToChecksum( i, checksum );
- stream << (Q_UINT16)i;
- i = (Q_UINT16)time.second();
+ stream << (TQ_UINT16)i;
+ i = (TQ_UINT16)time.second();
addToChecksum( i, checksum );
- stream << (Q_UINT16)i;
- i = (Q_UINT16)date.dayOfWeek();
+ stream << (TQ_UINT16)i;
+ i = (TQ_UINT16)date.dayOfWeek();
addToChecksum( i, checksum );
- stream << (Q_UINT16)i;
+ stream << (TQ_UINT16)i;
break;
/*
case attMSGSTATUS:
{
- Q_UINT8 c;
- Q_UINT32 flag = 0;
+ TQ_UINT8 c;
+ TQ_UINT32 flag = 0;
if ( c & fmsRead ) flag |= MSGFLAG_READ;
if ( !( c & fmsModified ) ) flag |= MSGFLAG_UNMODIFIED;
if ( c & fmsSubmitted ) flag |= MSGFLAG_SUBMIT;
@@ -280,10 +280,10 @@ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) {
d->stream_ >> c;
i = property->value().toUInt();
- stream << (Q_UINT8)LVL_MESSAGE;
- stream << (Q_UINT32)type;
- stream << (Q_UINT32)2;
- stream << (Q_UINT8)i;
+ stream << (TQ_UINT8)LVL_MESSAGE;
+ stream << (TQ_UINT32)type;
+ stream << (TQ_UINT32)2;
+ stream << (TQ_UINT8)i;
addToChecksum( i, checksum );
// from reader: d->message_->addProperty( 0x0E07, MAPI_TYPE_ULONG, flag );
}
@@ -296,7 +296,7 @@ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) {
return false;
}
- stream << (Q_UINT16)checksum;
+ stream << (TQ_UINT16)checksum;
return true;
}
@@ -485,7 +485,7 @@ void KTNEFWriter::setSummary( const TQString &s ) {
// TNEF encoding: Normal = 3, high = 2, low = 1
// MAPI encoding: Normal = -1, high = 0, low = 1
void KTNEFWriter::setPriority( Priority p ) {
- TQVariant v( (Q_UINT32)p );
+ TQVariant v( (TQ_UINT32)p );
addProperty( attMSGPRIORITY, atpSHORT, v );
}