summaryrefslogtreecommitdiffstats
path: root/kmail/messagecomposer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/messagecomposer.cpp')
-rw-r--r--kmail/messagecomposer.cpp250
1 files changed, 125 insertions, 125 deletions
diff --git a/kmail/messagecomposer.cpp b/kmail/messagecomposer.cpp
index 2cf5b8138..8d9950738 100644
--- a/kmail/messagecomposer.cpp
+++ b/kmail/messagecomposer.cpp
@@ -74,10 +74,10 @@
#include <kinputdialog.h>
#include <kdebug.h>
#include <kaction.h>
-#include <qfile.h>
-#include <qtextcodec.h>
-#include <qtextedit.h>
-#include <qtimer.h>
+#include <tqfile.h>
+#include <tqtextcodec.h>
+#include <tqtextedit.h>
+#include <tqtimer.h>
#include <gpgmepp/key.h>
#include <gpgmepp/keylistresult.h>
@@ -218,11 +218,11 @@ static inline int signingChainCertNearExpiryWarningThresholdInDays() {
"Encrypt whenever possible" (aka opportunistic encryption).
*/
-static QString mErrorProcessingStructuringInfo =
+static TQString mErrorProcessingStructuringInfo =
i18n("<qt><p>Structuring information returned by the Crypto plug-in "
"could not be processed correctly; the plug-in might be damaged.</p>"
"<p>Please contact your system administrator.</p></qt>");
-static QString mErrorNoCryptPlugAndNoBuildIn =
+static TQString mErrorNoCryptPlugAndNoBuildIn =
i18n("<p>No active Crypto Plug-In was found and the built-in OpenPGP code "
"did not run successfully.</p>"
"<p>You can do two things to change this:</p>"
@@ -287,7 +287,7 @@ public:
};
MessageComposer::MessageComposer( KMComposeWin* win, const char* name )
- : QObject( win, name ), mComposeWin( win ), mCurrentJob( 0 ),
+ : TQObject( win, name ), mComposeWin( win ), mCurrentJob( 0 ),
mReferenceMessage( 0 ), mKeyResolver( 0 ),
mUseOpportunisticEncryption( false ),
mSignBody( false ), mEncryptBody( false ),
@@ -319,7 +319,7 @@ void MessageComposer::applyChanges( bool disableCrypto )
{
// Do the initial setup
if( getenv("KMAIL_DEBUG_COMPOSER_CRYPTO") != 0 ) {
- QCString cE = getenv("KMAIL_DEBUG_COMPOSER_CRYPTO");
+ TQCString cE = getenv("KMAIL_DEBUG_COMPOSER_CRYPTO");
mDebugComposerCrypto = cE == "1" || cE.upper() == "ON" || cE.upper() == "TRUE";
kdDebug(5006) << "KMAIL_DEBUG_COMPOSER_CRYPTO = TRUE" << endl;
} else {
@@ -372,13 +372,13 @@ void MessageComposer::doNextJob()
}
// We have more jobs to do, but allow others to come first
- QTimer::singleShot( 0, this, SLOT( slotDoNextJob() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( slotDoNextJob() ) );
}
void MessageComposer::emitDone( bool b )
{
// Save memory - before sending the mail
- mEncodedBody = QByteArray();
+ mEncodedBody = TQByteArray();
delete mNewBodyPart; mNewBodyPart = 0;
mOldBodyPart.clear();
emit done( b );
@@ -437,7 +437,7 @@ void MessageComposer::readFromComposeWin()
mAllowedCryptoMessageFormats = mComposeWin->cryptoMessageFormat();
if( mAutoCharset ) {
- QCString charset = KMMsgBase::autoDetectCharset( mCharset, KMMessage::preferredCharsets(), mComposeWin->mEditor->text() );
+ TQCString charset = KMMsgBase::autoDetectCharset( mCharset, KMMessage::preferredCharsets(), mComposeWin->mEditor->text() );
if( charset.isEmpty() )
{
KMessageBox::sorry( mComposeWin,
@@ -474,9 +474,9 @@ void MessageComposer::readFromComposeWin()
if (id.isDefault())
mReferenceMessage->removeHeaderField("X-KMail-Identity");
- else mReferenceMessage->setHeaderField("X-KMail-Identity", QString::number( id.uoid() ));
+ else mReferenceMessage->setHeaderField("X-KMail-Identity", TQString::number( id.uoid() ));
- QString replyAddr;
+ TQString replyAddr;
if (!mComposeWin->replyTo().isEmpty()) replyAddr = mComposeWin->replyTo();
else replyAddr = mComposeWin->from();
@@ -495,7 +495,7 @@ void MessageComposer::readFromComposeWin()
int num = GlobalSettings::self()->custHeaderCount();
for(int ix=0; ix<num; ix++) {
- CustomMimeHeader customMimeHeader( QString::number(ix) );
+ CustomMimeHeader customMimeHeader( TQString::number(ix) );
customMimeHeader.readConfig();
mReferenceMessage->setHeaderField(
KMMsgBase::toUsAscii( customMimeHeader.custHeaderName() ),
@@ -530,8 +530,8 @@ void MessageComposer::readFromComposeWin()
mLineBreakColumn = mComposeWin->mEditor->lineBreakColumn();
}
-static QCString escape_quoted_string( const QCString & str ) {
- QCString result;
+static TQCString escape_quoted_string( const TQCString & str ) {
+ TQCString result;
const unsigned int str_len = str.length();
result.resize( 2*str_len + 1 );
char * d = result.data();
@@ -548,12 +548,12 @@ static QCString escape_quoted_string( const QCString & str ) {
}
bool MessageComposer::encryptWithChiasmus( const Kleo::CryptoBackend::Protocol * chiasmus,
- const QByteArray& body,
- QByteArray& resultData )
+ const TQByteArray& body,
+ TQByteArray& resultData )
{
- std::auto_ptr<Kleo::SpecialJob> job( chiasmus->specialJob( "x-encrypt", QMap<QString,QVariant>() ) );
+ std::auto_ptr<Kleo::SpecialJob> job( chiasmus->specialJob( "x-encrypt", TQMap<TQString,TQVariant>() ) );
if ( !job.get() ) {
- const QString msg = i18n( "Chiasmus backend does not offer the "
+ const TQString msg = i18n( "Chiasmus backend does not offer the "
"\"x-encrypt\" function. Please report this bug." );
KMessageBox::error( mComposeWin, msg, i18n( "Chiasmus Backend Error" ) );
return false;
@@ -561,7 +561,7 @@ bool MessageComposer::encryptWithChiasmus( const Kleo::CryptoBackend::Protocol *
if ( !job->setProperty( "key", GlobalSettings::chiasmusKey() ) ||
!job->setProperty( "options", GlobalSettings::chiasmusOptions() ) ||
!job->setProperty( "input", body ) ) {
- const QString msg = i18n( "The \"x-encrypt\" function does not accept "
+ const TQString msg = i18n( "The \"x-encrypt\" function does not accept "
"the expected parameters. Please report this bug." );
KMessageBox::error( mComposeWin, msg, i18n( "Chiasmus Backend Error" ) );
return false;
@@ -572,9 +572,9 @@ bool MessageComposer::encryptWithChiasmus( const Kleo::CryptoBackend::Protocol *
job->showErrorDialog( mComposeWin, i18n( "Chiasmus Encryption Error" ) );
return false;
}
- const QVariant result = job->property( "result" );
- if ( result.type() != QVariant::ByteArray ) {
- const QString msg = i18n( "Unexpected return value from Chiasmus backend: "
+ const TQVariant result = job->property( "result" );
+ if ( result.type() != TQVariant::ByteArray ) {
+ const TQString msg = i18n( "Unexpected return value from Chiasmus backend: "
"The \"x-encrypt\" function did not return a "
"byte array. Please report this bug." );
KMessageBox::error( mComposeWin, msg, i18n( "Chiasmus Backend Error" ) );
@@ -595,30 +595,30 @@ void MessageComposer::chiasmusEncryptAllAttachments() {
assert( chiasmus ); // kmcomposewin code should have made sure
- for ( QValueVector<Attachment>::iterator it = mAttachments.begin(), end = mAttachments.end() ; it != end ; ++it ) {
+ for ( TQValueVector<Attachment>::iterator it = mAttachments.begin(), end = mAttachments.end() ; it != end ; ++it ) {
KMMessagePart * part = it->part;
- const QString filename = part->fileName();
+ const TQString filename = part->fileName();
if ( filename.endsWith( ".xia", false ) )
continue; // already encrypted
- const QByteArray body = part->bodyDecodedBinary();
- QByteArray resultData;
+ const TQByteArray body = part->bodyDecodedBinary();
+ TQByteArray resultData;
if ( !encryptWithChiasmus( chiasmus, body, resultData ) ) {
mRc = false;
return;
}
// everything ok, so let's fill in the part again:
- QValueList<int> dummy;
+ TQValueList<int> dummy;
part->setBodyAndGuessCte( resultData, dummy );
part->setTypeStr( "application" );
part->setSubtypeStr( "vnd.de.bund.bsi.chiasmus" );
part->setName( filename + ".xia" );
// this is taken from kmmsgpartdlg.cpp:
- QCString encoding = KMMsgBase::autoDetectCharset( part->charset(), KMMessage::preferredCharsets(), filename );
+ TQCString encoding = KMMsgBase::autoDetectCharset( part->charset(), KMMessage::preferredCharsets(), filename );
if ( encoding.isEmpty() )
encoding = "utf-8";
- const QCString enc_name = KMMsgBase::encodeRFC2231String( filename + ".xia", encoding );
- const QCString cDisp = "attachment;\n\tfilename"
- + ( QString( enc_name ) != filename + ".xia"
+ const TQCString enc_name = KMMsgBase::encodeRFC2231String( filename + ".xia", encoding );
+ const TQCString cDisp = "attachment;\n\tfilename"
+ + ( TQString( enc_name ) != filename + ".xia"
? "*=" + enc_name
: "=\"" + escape_quoted_string( enc_name ) + '\"' );
part->setContentDisposition( cDisp );
@@ -683,7 +683,7 @@ void MessageComposer::adjustCryptFlags()
const KPIM::Identity & id =
kmkernel->identityManager()->identityForUoidOrDefault( mIdentityUid );
- QStringList encryptToSelfKeys;
+ TQStringList encryptToSelfKeys;
if ( !id.pgpEncryptionKey().isEmpty() )
encryptToSelfKeys.push_back( id.pgpEncryptionKey() );
if ( !id.smimeEncryptionKey().isEmpty() )
@@ -693,7 +693,7 @@ void MessageComposer::adjustCryptFlags()
return;
}
- QStringList signKeys;
+ TQStringList signKeys;
if ( !id.pgpSigningKey().isEmpty() )
signKeys.push_back( mPGPSigningKey = id.pgpSigningKey() );
if ( !id.smimeSigningKey().isEmpty() )
@@ -757,7 +757,7 @@ bool MessageComposer::determineWhetherToSign( bool doSignCompletely ) {
{
// the user wants to be asked or has to be asked
const KCursorSaver idle( KBusyPtr::idle() );
- const QString msg = i18n("Examination of the recipient's signing preferences "
+ const TQString msg = i18n("Examination of the recipient's signing preferences "
"yielded that you be asked whether or not to sign "
"this message.\n"
"Sign this message?");
@@ -781,7 +781,7 @@ bool MessageComposer::determineWhetherToSign( bool doSignCompletely ) {
{
// warn the user that there are conflicting signing preferences
const KCursorSaver idle( KBusyPtr::idle() );
- const QString msg = i18n("There are conflicting signing preferences "
+ const TQString msg = i18n("There are conflicting signing preferences "
"for these recipients.\n"
"Sign this message?");
switch ( KMessageBox::warningYesNoCancel( mComposeWin, msg,
@@ -803,7 +803,7 @@ bool MessageComposer::determineWhetherToSign( bool doSignCompletely ) {
case Kleo::Impossible:
{
const KCursorSaver idle( KBusyPtr::idle() );
- const QString msg = i18n("You have requested to sign this message, "
+ const TQString msg = i18n("You have requested to sign this message, "
"but no valid signing keys have been configured "
"for this identity.");
if ( KMessageBox::warningContinueCancel( mComposeWin, msg,
@@ -822,14 +822,14 @@ bool MessageComposer::determineWhetherToSign( bool doSignCompletely ) {
if ( !sign || !doSignCompletely ) {
if ( warnSendUnsigned() ) {
const KCursorSaver idle( KBusyPtr::idle() );
- const QString msg = sign && !doSignCompletely
+ const TQString msg = sign && !doSignCompletely
? i18n("Some parts of this message will not be signed.\n"
"Sending only partially signed messages might violate site policy.\n"
"Sign all parts instead?") // oh, I hate this...
: i18n("This message will not be signed.\n"
"Sending unsigned message might violate site policy.\n"
"Sign message instead?") ; // oh, I hate this...
- const QString buttonText = sign && !doSignCompletely
+ const TQString buttonText = sign && !doSignCompletely
? i18n("&Sign All Parts") : i18n("&Sign") ;
switch ( KMessageBox::warningYesNoCancel( mComposeWin, msg,
i18n("Unsigned-Message Warning"),
@@ -871,7 +871,7 @@ bool MessageComposer::determineWhetherToEncrypt( bool doEncryptCompletely ) {
{
// the user wants to be asked or has to be asked
const KCursorSaver idle( KBusyPtr::idle() );
- const QString msg = opportunistic
+ const TQString msg = opportunistic
? i18n("Valid trusted encryption keys were found for all recipients.\n"
"Encrypt this message?")
: i18n("Examination of the recipient's encryption preferences "
@@ -902,7 +902,7 @@ bool MessageComposer::determineWhetherToEncrypt( bool doEncryptCompletely ) {
{
// warn the user that there are conflicting encryption preferences
const KCursorSaver idle( KBusyPtr::idle() );
- const QString msg = i18n("There are conflicting encryption preferences "
+ const TQString msg = i18n("There are conflicting encryption preferences "
"for these recipients.\n"
"Encrypt this message?");
switch ( KMessageBox::warningYesNoCancel( mComposeWin, msg,
@@ -924,7 +924,7 @@ bool MessageComposer::determineWhetherToEncrypt( bool doEncryptCompletely ) {
case Kleo::Impossible:
{
const KCursorSaver idle( KBusyPtr::idle() );
- const QString msg = i18n("You have requested to encrypt this message, "
+ const TQString msg = i18n("You have requested to encrypt this message, "
"and to encrypt a copy to yourself, "
"but no valid trusted encryption keys have been "
"configured for this identity.");
@@ -944,7 +944,7 @@ bool MessageComposer::determineWhetherToEncrypt( bool doEncryptCompletely ) {
if ( !encrypt || !doEncryptCompletely ) {
if ( warnSendUnencrypted() ) {
const KCursorSaver idle( KBusyPtr::idle() );
- const QString msg = !doEncryptCompletely
+ const TQString msg = !doEncryptCompletely
? i18n("Some parts of this message will not be encrypted.\n"
"Sending only partially encrypted messages might violate site policy "
"and/or leak sensitive information.\n"
@@ -953,7 +953,7 @@ bool MessageComposer::determineWhetherToEncrypt( bool doEncryptCompletely ) {
"Sending unencrypted messages might violate site policy and/or "
"leak sensitive information.\n"
"Encrypt messages instead?") ; // oh, I hate this...
- const QString buttonText = !doEncryptCompletely
+ const TQString buttonText = !doEncryptCompletely
? i18n("&Encrypt All Parts") : i18n("&Encrypt") ;
switch ( KMessageBox::warningYesNoCancel( mComposeWin, msg,
i18n("Unencrypted Message Warning"),
@@ -978,13 +978,13 @@ bool MessageComposer::determineWhetherToEncrypt( bool doEncryptCompletely ) {
void MessageComposer::markAllAttachmentsForSigning( bool sign ) {
mSignBody = sign;
- for ( QValueVector<Attachment>::iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it )
+ for ( TQValueVector<Attachment>::iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it )
it->sign = sign;
}
void MessageComposer::markAllAttachmentsForEncryption( bool enc ) {
mEncryptBody = enc;
- for ( QValueVector<Attachment>::iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it )
+ for ( TQValueVector<Attachment>::iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it )
it->encrypt = enc;
}
@@ -1145,7 +1145,7 @@ static inline GpgME::Context::SignatureMode signingMode( Kleo::CryptoMessageForm
class EncryptMessageJob : public MessageComposerJob {
public:
EncryptMessageJob( KMMessage* msg, const Kleo::KeyResolver::SplitInfo & si,
- bool doSign, bool doEncrypt, const QByteArray& encodedBody,
+ bool doSign, bool doEncrypt, const TQByteArray& encodedBody,
int boundaryLevel, /*const KMMessagePart& oldBodyPart,*/
KMMessagePart* newBodyPart, Kleo::CryptoMessageFormat format,
MessageComposer* composer )
@@ -1173,7 +1173,7 @@ private:
KMMessage* mMsg;
Kleo::KeyResolver::SplitInfo mSplitInfo;
bool mDoSign, mDoEncrypt;
- QByteArray mEncodedBody;
+ TQByteArray mEncodedBody;
int mBoundaryLevel;
//KMMessagePart mOldBodyPart;
KMMessagePart* mNewBodyPart;
@@ -1196,7 +1196,7 @@ void MessageComposer::composeInlineOpenPGPMessage( KMMessage& theMessage,
bool doSign, bool doEncrypt )
{
// preprocess the body text
- const QByteArray bodyData = mText;
+ const TQByteArray bodyData = mText;
if (bodyData.isNull()) {
mRc = false;
return;
@@ -1208,7 +1208,7 @@ void MessageComposer::composeInlineOpenPGPMessage( KMMessage& theMessage,
// set the main headers
theMessage.deleteBodyParts();
- QString oldContentType = theMessage.headerField( "Content-Type" );
+ TQString oldContentType = theMessage.headerField( "Content-Type" );
theMessage.removeHeaderField("Content-Type");
theMessage.removeHeaderField("Content-Transfer-Encoding");
@@ -1223,7 +1223,7 @@ void MessageComposer::composeInlineOpenPGPMessage( KMMessage& theMessage,
KMMessage* msg = new KMMessage( theMessage );
if ( doEncrypt ) {
Kpgp::Result result;
- QByteArray encryptedBody;
+ TQByteArray encryptedBody;
if ( doSign ) { // Sign and encrypt
const std::vector<GpgME::Key> signingKeys = mKeyResolver->signingKeys( Kleo::InlineOpenPGPFormat );
result = pgpSignedAndEncryptedMsg( encryptedBody, bodyData, signingKeys,
@@ -1278,7 +1278,7 @@ void MessageComposer::composeChiasmusMessage( KMMessage& theMessage, Kleo::Crypt
assert( chiasmus ); // kmcomposewin code should have made sure
// preprocess the body text
- const QByteArray bodyData = mText;
+ const TQByteArray bodyData = mText;
if (bodyData.isNull()) {
mRc = false;
return;
@@ -1290,7 +1290,7 @@ void MessageComposer::composeChiasmusMessage( KMMessage& theMessage, Kleo::Crypt
// set the main headers
theMessage.deleteBodyParts();
- QString oldContentType = theMessage.headerField( "Content-Type" );
+ TQString oldContentType = theMessage.headerField( "Content-Type" );
theMessage.removeHeaderField("Content-Type");
theMessage.removeHeaderField("Content-Transfer-Encoding");
@@ -1303,7 +1303,7 @@ void MessageComposer::composeChiasmusMessage( KMMessage& theMessage, Kleo::Crypt
{
const Kleo::KeyResolver::SplitInfo& splitInfo = *it;
KMMessage* msg = new KMMessage( theMessage );
- QByteArray encryptedBody;
+ TQByteArray encryptedBody;
if ( !encryptWithChiasmus( chiasmus, bodyData, encryptedBody ) ) {
mRc = false;
@@ -1314,7 +1314,7 @@ void MessageComposer::composeChiasmusMessage( KMMessage& theMessage, Kleo::Crypt
//mOldBodyPart.setBodyEncodedBinary( encryptedBody );
bool doSign = false;
- QValueList<int> allowedCTEs;
+ TQValueList<int> allowedCTEs;
mOldBodyPart.setBodyAndGuessCte( encryptedBody, allowedCTEs,
!kmkernel->msgSender()->sendQuotedPrintable() && !doSign,
doSign );
@@ -1326,7 +1326,7 @@ void MessageComposer::composeChiasmusMessage( KMMessage& theMessage, Kleo::Crypt
// Used in case of attachments
mOldBodyPart.setTypeStr( "application" );
mOldBodyPart.setSubtypeStr( "vnd.de.bund.bsi.chiasmus-text" );
- mOldBodyPart.setAdditionalCTypeParamStr( QCString( "chiasmus-charset=" + mCharset ) );
+ mOldBodyPart.setAdditionalCTypeParamStr( TQCString( "chiasmus-charset=" + mCharset ) );
addBodyAndAttachments( msg, splitInfo, false, false, mOldBodyPart, Kleo::InlineOpenPGPFormat );
mMessageList.push_back( msg );
@@ -1362,14 +1362,14 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
theMessage.setBody( "This message is in MIME format." );
// preprocess the body text
- QByteArray bodyData = mText;
+ TQByteArray bodyData = mText;
if (bodyData.isNull()) {
mRc = false;
return;
}
// set the main headers
- QString oldContentType = theMessage.headerField( "Content-Type" );
+ TQString oldContentType = theMessage.headerField( "Content-Type" );
theMessage.deleteBodyParts();
theMessage.removeHeaderField("Content-Type");
theMessage.removeHeaderField("Content-Transfer-Encoding");
@@ -1394,7 +1394,7 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
// test whether there ARE attachments that can be included into the body
if( mEarlyAddAttachments ) {
bool someOk = false;
- for ( QValueVector<Attachment>::const_iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it ) {
+ for ( TQValueVector<Attachment>::const_iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it ) {
if ( it->encrypt == doEncryptBody && it->sign == doSignBody )
someOk = true;
else
@@ -1427,18 +1427,18 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
if ( mIsRichText ) { // create a multipart body
// calculate a boundary string
- QCString boundaryCStr; // storing boundary string data
- QCString newbody;
+ TQCString boundaryCStr; // storing boundary string data
+ TQCString newbody;
DwMediaType tmpCT;
tmpCT.CreateBoundary( ++mPreviousBoundaryLevel );
boundaryCStr = KMail::Util::CString( tmpCT.Boundary() );
- QValueList<int> allowedCTEs;
+ TQValueList<int> allowedCTEs;
KMMessagePart textBodyPart;
textBodyPart.setTypeStr("text");
textBodyPart.setSubtypeStr("plain");
- QCString textbody = plainTextFromMarkup( mText /* converted to QString */ );
+ TQCString textbody = plainTextFromMarkup( mText /* converted to TQString */ );
// the signed body must not be 8bit encoded
textBodyPart.setBodyAndGuessCte( textbody, allowedCTEs,
@@ -1458,7 +1458,7 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
KMMessagePart htmlBodyPart;
htmlBodyPart.setTypeStr("text");
htmlBodyPart.setSubtypeStr("html");
- QByteArray htmlbody = mText;
+ TQByteArray htmlbody = mText;
// the signed body must not be 8bit encoded
htmlBodyPart.setBodyAndGuessCte( htmlbody, allowedCTEs,
!kmkernel->msgSender()->sendQuotedPrintable() && !doSign,
@@ -1484,7 +1484,7 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
}
// Prepare attachments that will be signed/encrypted
- for ( QValueVector<Attachment>::const_iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it ) {
+ for ( TQValueVector<Attachment>::const_iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it ) {
// signed/encrypted body parts must be either QP or base64 encoded
// Why not 7 bit? Because the LF->CRLF canonicalization would render
// e.g. 7 bit encoded shell scripts unusable because of the CRs.
@@ -1493,12 +1493,12 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
// respect the CRLF->LF de-canonicalisation. We should
// eventually get rid of this:
if( it->sign || it->encrypt ) {
- QCString cte = it->part->cteStr().lower();
+ TQCString cte = it->part->cteStr().lower();
if( ( "8bit" == cte && it->part->type() != DwMime::kTypeMessage )
|| ( ( it->part->type() == DwMime::kTypeText )
&& ( "7bit" == cte ) ) ) {
- const QByteArray body = it->part->bodyDecodedBinary();
- QValueList<int> dummy;
+ const TQByteArray body = it->part->bodyDecodedBinary();
+ TQValueList<int> dummy;
it->part->setBodyAndGuessCte(body, dummy, false, it->sign);
kdDebug(5006) << "Changed encoding of message part from "
<< cte << " to " << it->part->cteStr() << endl;
@@ -1517,7 +1517,7 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
innerBodyPart.setOriginalContentTypeStr( oldContentType.utf8() );
}
innerBodyPart.setContentDisposition( "inline" );
- QValueList<int> allowedCTEs;
+ TQValueList<int> allowedCTEs;
// the signed body must not be 8bit encoded
innerBodyPart.setBodyAndGuessCte( bodyData, allowedCTEs,
!kmkernel->msgSender()->sendQuotedPrintable() && !doSign,
@@ -1527,11 +1527,11 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
innerBodyPart.setBodyEncodedBinary( bodyData ); // do we need this, since setBodyAndGuessCte does this already?
DwBodyPart* innerDwPart = theMessage.createDWBodyPart( &innerBodyPart );
innerDwPart->Assemble();
- QByteArray tmpbody = KMail::Util::ByteArray( innerDwPart->AsString() );
+ TQByteArray tmpbody = KMail::Util::ByteArray( innerDwPart->AsString() );
if ( mIsRichText ) { // and add our mp/a boundary
int boundPos = tmpbody.find( '\n' );
if( -1 < boundPos ) {
- QCString bStr( ";\n boundary=\"" );
+ TQCString bStr( ";\n boundary=\"" );
bStr += mSaveBoundary.c_str();
bStr += "\"";
bodyData = tmpbody;
@@ -1547,19 +1547,19 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
innerDwPart = 0;
// add all matching Attachments
// NOTE: This code will be changed when KMime is complete.
- for ( QValueVector<Attachment>::iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it ) {
+ for ( TQValueVector<Attachment>::iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it ) {
if ( it->encrypt == doEncryptBody && it->sign == doSignBody ) {
innerDwPart = theMessage.createDWBodyPart( it->part );
innerDwPart->Assemble();
- KMail::Util::append( bodyData, QCString( "\n--" + mMultipartMixedBoundary + "\n" ) );
+ KMail::Util::append( bodyData, TQCString( "\n--" + mMultipartMixedBoundary + "\n" ) );
KMail::Util::append( bodyData, innerDwPart->AsString().c_str() );
delete innerDwPart;
innerDwPart = 0;
}
}
- KMail::Util::append( bodyData, QCString( "\n--" + mMultipartMixedBoundary + "--\n" ) );
+ KMail::Util::append( bodyData, TQCString( "\n--" + mMultipartMixedBoundary + "--\n" ) );
} else { // !earlyAddAttachments
- QValueList<int> allowedCTEs;
+ TQValueList<int> allowedCTEs;
// the signed body must not be 8bit encoded
mOldBodyPart.setBodyAndGuessCte(bodyData, allowedCTEs, !kmkernel->msgSender()->sendQuotedPrintable() && !doSign,
doSign);
@@ -1595,7 +1595,7 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
int boundPos = mEncodedBody.find( '\n' );
if( -1 < boundPos ) {
// insert new "boundary" parameter
- QCString bStr( ";\n boundary=\"" );
+ TQCString bStr( ";\n boundary=\"" );
bStr += mMultipartMixedBoundary;
bStr += "\"";
KMail::Util::insert( mEncodedBody, boundPos, bStr.data() );
@@ -1618,7 +1618,7 @@ void MessageComposer::composeMessage( KMMessage& theMessage,
mRc = false;
return;
}
- mRc = processStructuringInfo( QString::null,
+ mRc = processStructuringInfo( TQString::null,
mOldBodyPart.contentDescription(),
mOldBodyPart.typeStr(),
mOldBodyPart.subtypeStr(),
@@ -1689,7 +1689,7 @@ void MessageComposer::encryptMessage( KMMessage* msg,
const bool doSignBody = doSign && mSignBody;
if ( doEncryptBody ) {
- QByteArray innerContent;
+ TQByteArray innerContent;
if ( doSignBody ) {
// extract signed body from newBodyPart
DwBodyPart* dwPart = msg->createDWBodyPart( &newBodyPart );
@@ -1708,7 +1708,7 @@ void MessageComposer::encryptMessage( KMMessage* msg,
innerContent = KMail::Util::lf2crlf( innerContent );
//kdDebug(5006) << " done." << endl;
- QByteArray encryptedBody;
+ TQByteArray encryptedBody;
Kpgp::Result result = pgpEncryptedMsg( encryptedBody, innerContent,
splitInfo.keys, format );
if ( result != Kpgp::Ok ) {
@@ -1769,7 +1769,7 @@ void MessageComposer::addBodyAndAttachments( KMMessage* msg,
// add Attachments
// create additional bodyparts for the attachments (if any)
KMMessagePart newAttachPart;
- for ( QValueVector<Attachment>::iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it ) {
+ for ( TQValueVector<Attachment>::iterator it = mAttachments.begin() ; it != mAttachments.end() ; ++it ) {
const bool cryptFlagsDifferent = ( it->encrypt != doEncryptBody || it->sign != doSignBody ) ;
@@ -1790,7 +1790,7 @@ void MessageComposer::addBodyAndAttachments( KMMessage* msg,
DwBodyPart* innerDwPart = msg->createDWBodyPart( it->part );
innerDwPart->Assemble();
- QByteArray encodedAttachment = KMail::Util::ByteArray( innerDwPart->AsString() );
+ TQByteArray encodedAttachment = KMail::Util::ByteArray( innerDwPart->AsString() );
delete innerDwPart;
innerDwPart = 0;
@@ -1831,7 +1831,7 @@ void MessageComposer::addBodyAndAttachments( KMMessage* msg,
}
}
if( encryptThisNow ) {
- QByteArray encryptedBody;
+ TQByteArray encryptedBody;
Kpgp::Result result = pgpEncryptedMsg( encryptedBody,
encodedAttachment,
splitInfo.keys,
@@ -1862,11 +1862,11 @@ void MessageComposer::addBodyAndAttachments( KMMessage* msg,
msg->headers().ContentType().Parse();
kdDebug(5006) << "MessageComposer::addBodyAndAttachments() : set top level Content-Type from originalContentTypeStr()=" << ourFineBodyPart.originalContentTypeStr() << endl;
} else {
- QCString ct = ourFineBodyPart.typeStr() + "/" + ourFineBodyPart.subtypeStr();
+ TQCString ct = ourFineBodyPart.typeStr() + "/" + ourFineBodyPart.subtypeStr();
if ( ct == "multipart/mixed" )
ct += ";\n\tboundary=\"" + mMultipartMixedBoundary + '"';
else if ( ct == "multipart/alternative" )
- ct += ";\n\tboundary=\"" + QCString(mSaveBoundary.c_str()) + '"';
+ ct += ";\n\tboundary=\"" + TQCString(mSaveBoundary.c_str()) + '"';
msg->headers().ContentType().FromString( ct );
msg->headers().ContentType().Parse();
kdDebug(5006) << "MessageComposer::addBodyAndAttachments() : set top level Content-Type to " << ct << endl;
@@ -1900,23 +1900,23 @@ void MessageComposer::addBodyAndAttachments( KMMessage* msg,
//-----------------------------------------------------------------------------
// This method does not call any crypto ops, so it does not need to be async
-bool MessageComposer::processStructuringInfo( const QString bugURL,
- const QString contentDescClear,
- const QCString contentTypeClear,
- const QCString contentSubtypeClear,
- const QCString contentDispClear,
- const QCString contentTEncClear,
- const QByteArray& clearCStr,
- const QString /*contentDescCiph*/,
- const QByteArray& ciphertext,
+bool MessageComposer::processStructuringInfo( const TQString bugURL,
+ const TQString contentDescClear,
+ const TQCString contentTypeClear,
+ const TQCString contentSubtypeClear,
+ const TQCString contentDispClear,
+ const TQCString contentTEncClear,
+ const TQByteArray& clearCStr,
+ const TQString /*contentDescCiph*/,
+ const TQByteArray& ciphertext,
KMMessagePart& resultingPart,
bool signing, Kleo::CryptoMessageFormat format )
{
- assert( clearCStr.isEmpty() || clearCStr[clearCStr.size()-1] != '\0' ); // I was called with a QCString !?
+ assert( clearCStr.isEmpty() || clearCStr[clearCStr.size()-1] != '\0' ); // I was called with a TQCString !?
bool bOk = true;
if ( makeMimeObject( format, signing ) ) {
- QCString mainHeader = "Content-Type: ";
+ TQCString mainHeader = "Content-Type: ";
const char * toplevelCT = toplevelContentType( format, signing );
if ( toplevelCT )
mainHeader += toplevelCT;
@@ -1927,7 +1927,7 @@ bool MessageComposer::processStructuringInfo( const QString bugURL,
mainHeader += contentTypeClear + '/' + contentSubtypeClear;
}
- const QCString boundaryCStr = KMime::multiPartBoundary();
+ const TQCString boundaryCStr = KMime::multiPartBoundary();
// add "boundary" parameter
if ( makeMultiMime( format, signing ) )
mainHeader.replace( "%boundary", boundaryCStr );
@@ -1960,7 +1960,7 @@ bool MessageComposer::processStructuringInfo( const QString bugURL,
KMMessage::bodyPart( &mainDwPa, &resultingPart );
if( !makeMultiMime( format, signing ) ) {
if ( signing && includeCleartextWhenSigning( format ) ) {
- QByteArray bodyText( clearCStr );
+ TQByteArray bodyText( clearCStr );
KMail::Util::append( bodyText, "\n" );
KMail::Util::append( bodyText, ciphertext );
resultingPart.setBodyEncodedBinary( bodyText );
@@ -1972,7 +1972,7 @@ bool MessageComposer::processStructuringInfo( const QString bugURL,
// Build a MIME part holding the version information
// taking the body contents returned in
// structuring.data.bodyTextVersion.
- QCString versCStr, codeCStr;
+ TQCString versCStr, codeCStr;
if ( !signing && format == Kleo::OpenPGPMIMEFormat )
versCStr =
"Content-Type: application/pgp-encrypted\n"
@@ -1996,10 +1996,10 @@ bool MessageComposer::processStructuringInfo( const QString bugURL,
codeCStr += "Content-Transfer-Encoding: base64\n\n";
codeCStr += KMime::Codec::codecForName( "base64" )->encodeToQCString( ciphertext );
} else
- codeCStr += '\n' + QCString( ciphertext.data(), ciphertext.size() + 1 );
+ codeCStr += '\n' + TQCString( ciphertext.data(), ciphertext.size() + 1 );
- QByteArray mainStr;
+ TQByteArray mainStr;
KMail::Util::append( mainStr, "--" );
KMail::Util::append( mainStr, boundaryCStr );
if ( signing && includeCleartextWhenSigning( format ) &&
@@ -2026,7 +2026,7 @@ bool MessageComposer::processStructuringInfo( const QString bugURL,
resultingPart.setSubtypeStr( contentSubtypeClear );
resultingPart.setContentDisposition( contentDispClear );
resultingPart.setContentTransferEncodingStr( contentTEncClear );
- QByteArray resultingBody;
+ TQByteArray resultingBody;
if ( signing && includeCleartextWhenSigning( format ) ) {
if( !clearCStr.isEmpty() )
@@ -2050,18 +2050,18 @@ bool MessageComposer::processStructuringInfo( const QString bugURL,
}
//-----------------------------------------------------------------------------
-QCString MessageComposer::plainTextFromMarkup( const QString& markupText )
+TQCString MessageComposer::plainTextFromMarkup( const TQString& markupText )
{
- QTextEdit *hackConspiratorTextEdit = new QTextEdit( markupText );
+ TQTextEdit *hackConspiratorTextEdit = new TQTextEdit( markupText );
hackConspiratorTextEdit->setTextFormat(Qt::PlainText);
if ( !mDisableBreaking ) {
- hackConspiratorTextEdit->setWordWrap( QTextEdit::FixedColumnWidth );
+ hackConspiratorTextEdit->setWordWrap( TQTextEdit::FixedColumnWidth );
hackConspiratorTextEdit->setWrapColumnOrWidth( mLineBreakColumn );
}
- QString text = hackConspiratorTextEdit->text();
- QCString textbody;
+ TQString text = hackConspiratorTextEdit->text();
+ TQCString textbody;
- const QTextCodec *codec = KMMsgBase::codecForName( mCharset );
+ const TQTextCodec *codec = KMMsgBase::codecForName( mCharset );
if( mCharset == "us-ascii" ) {
textbody = KMMsgBase::toUsAscii( text );
} else if( codec == 0 ) {
@@ -2078,10 +2078,10 @@ QCString MessageComposer::plainTextFromMarkup( const QString& markupText )
}
//-----------------------------------------------------------------------------
-QByteArray MessageComposer::breakLinesAndApplyCodec()
+TQByteArray MessageComposer::breakLinesAndApplyCodec()
{
- QString text;
- QCString cText;
+ TQString text;
+ TQCString cText;
if( mDisableBreaking || mIsRichText || !GlobalSettings::self()->wordWrap() )
text = mComposeWin->mEditor->text();
@@ -2089,16 +2089,16 @@ QByteArray MessageComposer::breakLinesAndApplyCodec()
text = mComposeWin->mEditor->brokenText();
text.truncate( text.length() ); // to ensure text.size()==text.length()+1
- QString newText;
- const QTextCodec *codec = KMMsgBase::codecForName( mCharset );
+ TQString newText;
+ const TQTextCodec *codec = KMMsgBase::codecForName( mCharset );
if( mCharset == "us-ascii" ) {
cText = KMMsgBase::toUsAscii( text );
- newText = QString::fromLatin1( cText );
+ newText = TQString::fromLatin1( cText );
} else if( codec == 0 ) {
kdDebug(5006) << "Something is wrong and I can not get a codec." << endl;
cText = text.local8Bit();
- newText = QString::fromLocal8Bit( cText );
+ newText = TQString::fromLocal8Bit( cText );
} else {
cText = codec->fromUnicode( text );
newText = codec->toUnicode( cText );
@@ -2106,7 +2106,7 @@ QByteArray MessageComposer::breakLinesAndApplyCodec()
if (cText.isNull()) cText = "";
if( !text.isEmpty() && (newText != text) ) {
- QString oldText = mComposeWin->mEditor->text();
+ TQString oldText = mComposeWin->mEditor->text();
mComposeWin->mEditor->setText( newText );
KCursorSaver idle( KBusyPtr::idle() );
bool anyway = ( KMessageBox::warningYesNo( mComposeWin,
@@ -2116,7 +2116,7 @@ QByteArray MessageComposer::breakLinesAndApplyCodec()
i18n("Lose Characters"), i18n("Change Encoding") ) == KMessageBox::Yes );
if( !anyway ) {
mComposeWin->mEditor->setText(oldText);
- return QByteArray();
+ return TQByteArray();
}
}
@@ -2140,10 +2140,10 @@ QByteArray MessageComposer::breakLinesAndApplyCodec()
//-----------------------------------------------------------------------------
-void MessageComposer::pgpSignedMsg( const QByteArray& cText, Kleo::CryptoMessageFormat format ) {
+void MessageComposer::pgpSignedMsg( const TQByteArray& cText, Kleo::CryptoMessageFormat format ) {
- assert( cText.isEmpty() || cText[cText.size()-1] != '\0' ); // I was called with a QCString !?
- mSignature = QByteArray();
+ assert( cText.isEmpty() || cText[cText.size()-1] != '\0' ); // I was called with a TQCString !?
+ mSignature = TQByteArray();
const std::vector<GpgME::Key> signingKeys = mKeyResolver->signingKeys( format );
@@ -2168,7 +2168,7 @@ void MessageComposer::pgpSignedMsg( const QByteArray& cText, Kleo::CryptoMessage
return;
}
- QByteArray signature;
+ TQByteArray signature;
const GpgME::SigningResult res =
job->exec( signingKeys, cText, signingMode( format ), signature );
if ( res.error().isCanceled() ) {
@@ -2194,8 +2194,8 @@ void MessageComposer::pgpSignedMsg( const QByteArray& cText, Kleo::CryptoMessage
}
//-----------------------------------------------------------------------------
-Kpgp::Result MessageComposer::pgpEncryptedMsg( QByteArray & encryptedBody,
- const QByteArray& cText,
+Kpgp::Result MessageComposer::pgpEncryptedMsg( TQByteArray & encryptedBody,
+ const TQByteArray& cText,
const std::vector<GpgME::Key> & encryptionKeys,
Kleo::CryptoMessageFormat format )
{
@@ -2235,8 +2235,8 @@ Kpgp::Result MessageComposer::pgpEncryptedMsg( QByteArray & encryptedBody,
return Kpgp::Ok;
}
-Kpgp::Result MessageComposer::pgpSignedAndEncryptedMsg( QByteArray & encryptedBody,
- const QByteArray& cText,
+Kpgp::Result MessageComposer::pgpSignedAndEncryptedMsg( TQByteArray & encryptedBody,
+ const TQByteArray& cText,
const std::vector<GpgME::Key> & signingKeys,
const std::vector<GpgME::Key> & encryptionKeys,
Kleo::CryptoMessageFormat format )