summaryrefslogtreecommitdiffstats
path: root/kmail/templateparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/templateparser.cpp')
-rw-r--r--kmail/templateparser.cpp306
1 files changed, 153 insertions, 153 deletions
diff --git a/kmail/templateparser.cpp b/kmail/templateparser.cpp
index 39591358b..4112b58ed 100644
--- a/kmail/templateparser.cpp
+++ b/kmail/templateparser.cpp
@@ -20,18 +20,18 @@
#include <config.h>
-#include <qstring.h>
-#include <qdatetime.h>
+#include <tqstring.h>
+#include <tqdatetime.h>
#include <klocale.h>
#include <kcalendarsystem.h>
#include <kmime_util.h>
#include <kglobal.h>
#include <kprocess.h>
-#include <qregexp.h>
-#include <qfile.h>
+#include <tqregexp.h>
+#include <tqfile.h>
#include <kmessagebox.h>
#include <kshell.h>
-#include <qfileinfo.h>
+#include <tqfileinfo.h>
#include "kmmessage.h"
#include "kmmsgbase.h"
@@ -47,7 +47,7 @@
#include "templateparser.h"
TemplateParser::TemplateParser( KMMessage *amsg, const Mode amode,
- const QString aselection,
+ const TQString aselection,
bool asmartQuote, bool anoQuote,
bool aallowDecryption, bool aselectionIsBody ) :
mMode( amode ), mFolder( 0 ), mIdentity( 0 ), mSelection( aselection ),
@@ -58,20 +58,20 @@ TemplateParser::TemplateParser( KMMessage *amsg, const Mode amode,
mMsg = amsg;
}
-int TemplateParser::parseQuotes( const QString &prefix, const QString &str,
- QString &quote ) const
+int TemplateParser::parseQuotes( const TQString &prefix, const TQString &str,
+ TQString &quote ) const
{
int pos = prefix.length();
int len;
int str_len = str.length();
- QChar qc = '"';
- QChar prev = 0;
+ TQChar qc = '"';
+ TQChar prev = 0;
pos++;
len = pos;
while ( pos < str_len ) {
- QChar c = str[pos];
+ TQChar c = str[pos];
pos++;
len++;
@@ -93,18 +93,18 @@ int TemplateParser::parseQuotes( const QString &prefix, const QString &str,
return len;
}
-QString TemplateParser::getFName( const QString &str )
+TQString TemplateParser::getFName( const TQString &str )
{
// simple logic:
// if there is ',' in name, than format is 'Last, First'
// else format is 'First Last'
// last resort -- return 'name' from 'name@domain'
int sep_pos;
- QString res;
+ TQString res;
if ( ( sep_pos = str.find( '@' ) ) > 0 ) {
int i;
for ( i = (sep_pos - 1); i >= 0; --i ) {
- QChar c = str[i];
+ TQChar c = str[i];
if ( c.isLetterOrNumber() ) {
res.prepend( c );
} else {
@@ -115,7 +115,7 @@ QString TemplateParser::getFName( const QString &str )
unsigned int i;
bool begin = false;
for ( i = sep_pos; i < str.length(); ++i ) {
- QChar c = str[i];
+ TQChar c = str[i];
if ( c.isLetterOrNumber() ) {
begin = true;
res.append( c );
@@ -126,7 +126,7 @@ QString TemplateParser::getFName( const QString &str )
} else {
unsigned int i;
for ( i = 0; i < str.length(); ++i ) {
- QChar c = str[i];
+ TQChar c = str[i];
if ( c.isLetterOrNumber() ) {
res.append( c );
} else {
@@ -137,17 +137,17 @@ QString TemplateParser::getFName( const QString &str )
return res;
}
-QString TemplateParser::getLName( const QString &str )
+TQString TemplateParser::getLName( const TQString &str )
{
// simple logic:
// if there is ',' in name, than format is 'Last, First'
// else format is 'First Last'
int sep_pos;
- QString res;
+ TQString res;
if ( ( sep_pos = str.find(',') ) > 0 ) {
int i;
for ( i = sep_pos; i >= 0; --i ) {
- QChar c = str[i];
+ TQChar c = str[i];
if ( c.isLetterOrNumber() ) {
res.prepend( c );
} else {
@@ -159,7 +159,7 @@ QString TemplateParser::getLName( const QString &str )
unsigned int i;
bool begin = false;
for ( i = sep_pos; i < str.length(); ++i ) {
- QChar c = str[i];
+ TQChar c = str[i];
if ( c.isLetterOrNumber() ) {
begin = true;
res.append( c );
@@ -177,30 +177,30 @@ void TemplateParser::process( KMMessage *aorig_msg, KMFolder *afolder, bool appe
mAppend = append;
mOrigMsg = aorig_msg;
mFolder = afolder;
- QString tmpl = findTemplate();
+ TQString tmpl = findTemplate();
return processWithTemplate( tmpl );
}
-void TemplateParser::process( const QString &tmplName, KMMessage *aorig_msg,
+void TemplateParser::process( const TQString &tmplName, KMMessage *aorig_msg,
KMFolder *afolder, bool append )
{
mAppend = append;
mOrigMsg = aorig_msg;
mFolder = afolder;
- QString tmpl = findCustomTemplate( tmplName );
+ TQString tmpl = findCustomTemplate( tmplName );
return processWithTemplate( tmpl );
}
-void TemplateParser::processWithTemplate( const QString &tmpl )
+void TemplateParser::processWithTemplate( const TQString &tmpl )
{
- QString body;
+ TQString body;
int tmpl_len = tmpl.length();
bool dnl = false;
for ( int i = 0; i < tmpl_len; ++i ) {
- QChar c = tmpl[i];
+ TQChar c = tmpl[i];
// kdDebug() << "Next char: " << c << endl;
if ( c == '%' ) {
- QString cmd = tmpl.mid( i + 1 );
+ TQString cmd = tmpl.mid( i + 1 );
if ( cmd.startsWith( "-" ) ) {
// dnl
@@ -211,27 +211,27 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
} else if ( cmd.startsWith( "REM=" ) ) {
// comments
kdDebug() << "Command: REM=" << endl;
- QString q;
+ TQString q;
int len = parseQuotes( "REM=", cmd, q );
i += len;
} else if ( cmd.startsWith( "INSERT=" ) ) {
// insert content of specified file as is
kdDebug() << "Command: INSERT=" << endl;
- QString q;
+ TQString q;
int len = parseQuotes( "INSERT=", cmd, q );
i += len;
- QString path = KShell::tildeExpand( q );
- QFileInfo finfo( path );
+ TQString path = KShell::tildeExpand( q );
+ TQFileInfo finfo( path );
if (finfo.isRelative() ) {
path = KShell::homeDir( "" );
path += '/';
path += q;
}
- QFile file( path );
+ TQFile file( path );
if ( file.open( IO_ReadOnly ) ) {
- QByteArray content = file.readAll();
- QString str = QString::fromLocal8Bit( content, content.size() );
+ TQByteArray content = file.readAll();
+ TQString str = TQString::fromLocal8Bit( content, content.size() );
body.append( str );
} else if ( mDebug ) {
KMessageBox::error( 0,
@@ -242,30 +242,30 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
} else if ( cmd.startsWith( "SYSTEM=" ) ) {
// insert content of specified file as is
kdDebug() << "Command: SYSTEM=" << endl;
- QString q;
+ TQString q;
int len = parseQuotes( "SYSTEM=", cmd, q );
i += len;
- QString pipe_cmd = q;
- QString str = pipe( pipe_cmd, "" );
+ TQString pipe_cmd = q;
+ TQString str = pipe( pipe_cmd, "" );
body.append( str );
} else if ( cmd.startsWith( "PUT=" ) ) {
// insert content of specified file as is
kdDebug() << "Command: PUT=" << endl;
- QString q;
+ TQString q;
int len = parseQuotes( "PUT=", cmd, q );
i += len;
- QString path = KShell::tildeExpand( q );
- QFileInfo finfo( path );
+ TQString path = KShell::tildeExpand( q );
+ TQFileInfo finfo( path );
if (finfo.isRelative() ) {
path = KShell::homeDir( "" );
path += '/';
path += q;
}
- QFile file( path );
+ TQFile file( path );
if ( file.open( IO_ReadOnly ) ) {
- QByteArray content = file.readAll();
- body.append( QString::fromLocal8Bit( content, content.size() ) );
+ TQByteArray content = file.readAll();
+ body.append( TQString::fromLocal8Bit( content, content.size() ) );
} else if ( mDebug ) {
KMessageBox::error( 0,
i18n( "Cannot insert content from file %1: %2").
@@ -275,13 +275,13 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
} else if ( cmd.startsWith( "QUOTEPIPE=" ) ) {
// pipe message body throw command and insert it as quotation
kdDebug() << "Command: QUOTEPIPE=" << endl;
- QString q;
+ TQString q;
int len = parseQuotes( "QUOTEPIPE=", cmd, q );
i += len;
- QString pipe_cmd = q;
+ TQString pipe_cmd = q;
if ( mOrigMsg && !mNoQuote ) {
- QString str = pipe( pipe_cmd, mSelection );
- QString quote = mOrigMsg->asQuotedString( "", mQuoteString, str,
+ TQString str = pipe( pipe_cmd, mSelection );
+ TQString quote = mOrigMsg->asQuotedString( "", mQuoteString, str,
mSmartQuote, mAllowDecryption );
body.append( quote );
}
@@ -290,7 +290,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: QUOTE" << endl;
i += strlen( "QUOTE" );
if ( mOrigMsg && !mNoQuote ) {
- QString quote = mOrigMsg->asQuotedString( "", mQuoteString, mSelection,
+ TQString quote = mOrigMsg->asQuotedString( "", mQuoteString, mSelection,
mSmartQuote, mAllowDecryption );
body.append( quote );
}
@@ -299,7 +299,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: QHEADERS" << endl;
i += strlen( "QHEADERS" );
if ( mOrigMsg && !mNoQuote ) {
- QString quote = mOrigMsg->asQuotedString( "", mQuoteString,
+ TQString quote = mOrigMsg->asQuotedString( "", mQuoteString,
mOrigMsg->headerAsSendableString(),
mSmartQuote, false );
body.append( quote );
@@ -309,53 +309,53 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: HEADERS" << endl;
i += strlen( "HEADERS" );
if ( mOrigMsg && !mNoQuote ) {
- QString str = mOrigMsg->headerAsSendableString();
+ TQString str = mOrigMsg->headerAsSendableString();
body.append( str );
}
} else if ( cmd.startsWith( "TEXTPIPE=" ) ) {
// pipe message body throw command and insert it as is
kdDebug() << "Command: TEXTPIPE=" << endl;
- QString q;
+ TQString q;
int len = parseQuotes( "TEXTPIPE=", cmd, q );
i += len;
- QString pipe_cmd = q;
+ TQString pipe_cmd = q;
if ( mOrigMsg ) {
- QString str = pipe(pipe_cmd, mSelection );
+ TQString str = pipe(pipe_cmd, mSelection );
body.append( str );
}
} else if ( cmd.startsWith( "MSGPIPE=" ) ) {
// pipe full message throw command and insert result as is
kdDebug() << "Command: MSGPIPE=" << endl;
- QString q;
+ TQString q;
int len = parseQuotes( "MSGPIPE=", cmd, q );
i += len;
- QString pipe_cmd = q;
+ TQString pipe_cmd = q;
if ( mOrigMsg ) {
- QString str = pipe(pipe_cmd, mOrigMsg->asString() );
+ TQString str = pipe(pipe_cmd, mOrigMsg->asString() );
body.append( str );
}
} else if ( cmd.startsWith( "BODYPIPE=" ) ) {
// pipe message body generated so far throw command and insert result as is
kdDebug() << "Command: BODYPIPE=" << endl;
- QString q;
+ TQString q;
int len = parseQuotes( "BODYPIPE=", cmd, q );
i += len;
- QString pipe_cmd = q;
- QString str = pipe( pipe_cmd, body );
+ TQString pipe_cmd = q;
+ TQString str = pipe( pipe_cmd, body );
body.append( str );
} else if ( cmd.startsWith( "CLEARPIPE=" ) ) {
// pipe message body generated so far throw command and
// insert result as is replacing current body
kdDebug() << "Command: CLEARPIPE=" << endl;
- QString q;
+ TQString q;
int len = parseQuotes( "CLEARPIPE=", cmd, q );
i += len;
- QString pipe_cmd = q;
- QString str = pipe( pipe_cmd, body );
+ TQString pipe_cmd = q;
+ TQString str = pipe( pipe_cmd, body );
body = str;
mMsg->setCursorPos( 0 );
@@ -363,7 +363,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: TEXT" << endl;
i += strlen( "TEXT" );
if ( mOrigMsg ) {
- QString quote = mOrigMsg->asPlainText( false, mAllowDecryption );
+ TQString quote = mOrigMsg->asPlainText( false, mAllowDecryption );
body.append( quote );
}
@@ -371,7 +371,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OTEXTSIZE" << endl;
i += strlen( "OTEXTSIZE" );
if ( mOrigMsg ) {
- QString str = QString( "%1" ).arg( mOrigMsg->body().length() );
+ TQString str = TQString( "%1" ).arg( mOrigMsg->body().length() );
body.append( str );
}
@@ -379,132 +379,132 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OTEXT" << endl;
i += strlen( "OTEXT" );
if ( mOrigMsg ) {
- QString quote = mOrigMsg->asPlainText( false, mAllowDecryption );
+ TQString quote = mOrigMsg->asPlainText( false, mAllowDecryption );
body.append( quote );
}
} else if ( cmd.startsWith( "CCADDR" ) ) {
kdDebug() << "Command: CCADDR" << endl;
i += strlen( "CCADDR" );
- QString str = mMsg->cc();
+ TQString str = mMsg->cc();
body.append( str );
} else if ( cmd.startsWith( "CCNAME" ) ) {
kdDebug() << "Command: CCNAME" << endl;
i += strlen( "CCNAME" );
- QString str = mMsg->ccStrip();
+ TQString str = mMsg->ccStrip();
body.append( str );
} else if ( cmd.startsWith( "CCFNAME" ) ) {
kdDebug() << "Command: CCFNAME" << endl;
i += strlen( "CCFNAME" );
- QString str = mMsg->ccStrip();
+ TQString str = mMsg->ccStrip();
body.append( getFName( str ) );
} else if ( cmd.startsWith( "CCLNAME" ) ) {
kdDebug() << "Command: CCLNAME" << endl;
i += strlen( "CCLNAME" );
- QString str = mMsg->ccStrip();
+ TQString str = mMsg->ccStrip();
body.append( getLName( str ) );
} else if ( cmd.startsWith( "TOADDR" ) ) {
kdDebug() << "Command: TOADDR" << endl;
i += strlen( "TOADDR" );
- QString str = mMsg->to();
+ TQString str = mMsg->to();
body.append( str );
} else if ( cmd.startsWith( "TONAME" ) ) {
kdDebug() << "Command: TONAME" << endl;
i += strlen( "TONAME" );
- QString str = mMsg->toStrip();
+ TQString str = mMsg->toStrip();
body.append( str );
} else if ( cmd.startsWith( "TOFNAME" ) ) {
kdDebug() << "Command: TOFNAME" << endl;
i += strlen( "TOFNAME" );
- QString str = mMsg->toStrip();
+ TQString str = mMsg->toStrip();
body.append( getFName( str ) );
} else if ( cmd.startsWith( "TOLNAME" ) ) {
kdDebug() << "Command: TOLNAME" << endl;
i += strlen( "TOLNAME" );
- QString str = mMsg->toStrip();
+ TQString str = mMsg->toStrip();
body.append( getLName( str ) );
} else if ( cmd.startsWith( "TOLIST" ) ) {
kdDebug() << "Command: TOLIST" << endl;
i += strlen( "TOLIST" );
- QString str = mMsg->to();
+ TQString str = mMsg->to();
body.append( str );
} else if ( cmd.startsWith( "FROMADDR" ) ) {
kdDebug() << "Command: FROMADDR" << endl;
i += strlen( "FROMADDR" );
- QString str = mMsg->from();
+ TQString str = mMsg->from();
body.append( str );
} else if ( cmd.startsWith( "FROMNAME" ) ) {
kdDebug() << "Command: FROMNAME" << endl;
i += strlen( "FROMNAME" );
- QString str = mMsg->fromStrip();
+ TQString str = mMsg->fromStrip();
body.append( str );
} else if ( cmd.startsWith( "FROMFNAME" ) ) {
kdDebug() << "Command: FROMFNAME" << endl;
i += strlen( "FROMFNAME" );
- QString str = mMsg->fromStrip();
+ TQString str = mMsg->fromStrip();
body.append( getFName( str ) );
} else if ( cmd.startsWith( "FROMLNAME" ) ) {
kdDebug() << "Command: FROMLNAME" << endl;
i += strlen( "FROMLNAME" );
- QString str = mMsg->fromStrip();
+ TQString str = mMsg->fromStrip();
body.append( getLName( str ) );
} else if ( cmd.startsWith( "FULLSUBJECT" ) ) {
kdDebug() << "Command: FULLSUBJECT" << endl;
i += strlen( "FULLSUBJECT" );
- QString str = mMsg->subject();
+ TQString str = mMsg->subject();
body.append( str );
} else if ( cmd.startsWith( "FULLSUBJ" ) ) {
kdDebug() << "Command: FULLSUBJ" << endl;
i += strlen( "FULLSUBJ" );
- QString str = mMsg->subject();
+ TQString str = mMsg->subject();
body.append( str );
} else if ( cmd.startsWith( "MSGID" ) ) {
kdDebug() << "Command: MSGID" << endl;
i += strlen( "MSGID" );
- QString str = mMsg->id();
+ TQString str = mMsg->id();
body.append( str );
} else if ( cmd.startsWith( "OHEADER=" ) ) {
// insert specified content of header from original message
kdDebug() << "Command: OHEADER=" << endl;
- QString q;
+ TQString q;
int len = parseQuotes( "OHEADER=", cmd, q );
i += len;
if ( mOrigMsg ) {
- QString hdr = q;
- QString str = mOrigMsg->headerFields(hdr.local8Bit() ).join( ", " );
+ TQString hdr = q;
+ TQString str = mOrigMsg->headerFields(hdr.local8Bit() ).join( ", " );
body.append( str );
}
} else if ( cmd.startsWith( "HEADER=" ) ) {
// insert specified content of header from current message
kdDebug() << "Command: HEADER=" << endl;
- QString q;
+ TQString q;
int len = parseQuotes( "HEADER=", cmd, q );
i += len;
- QString hdr = q;
- QString str = mMsg->headerFields(hdr.local8Bit() ).join( ", " );
+ TQString hdr = q;
+ TQString str = mMsg->headerFields(hdr.local8Bit() ).join( ", " );
body.append( str );
} else if ( cmd.startsWith( "HEADER( " ) ) {
// insert specified content of header from current message
kdDebug() << "Command: HEADER( " << endl;
- QRegExp re = QRegExp( "^HEADER\\((.+)\\)" );
+ TQRegExp re = TQRegExp( "^HEADER\\((.+)\\)" );
re.setMinimal( true );
int res = re.search( cmd );
if ( res != 0 ) {
@@ -512,8 +512,8 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
i += strlen( "HEADER( " );
} else {
i += re.matchedLength();
- QString hdr = re.cap( 1 );
- QString str = mMsg->headerFields( hdr.local8Bit() ).join( ", " );
+ TQString hdr = re.cap( 1 );
+ TQString str = mMsg->headerFields( hdr.local8Bit() ).join( ", " );
body.append( str );
}
@@ -521,7 +521,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OCCADDR" << endl;
i += strlen( "OCCADDR" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->cc();
+ TQString str = mOrigMsg->cc();
body.append( str );
}
@@ -529,7 +529,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OCCNAME" << endl;
i += strlen( "OCCNAME" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->ccStrip();
+ TQString str = mOrigMsg->ccStrip();
body.append( str );
}
@@ -537,7 +537,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OCCFNAME" << endl;
i += strlen( "OCCFNAME" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->ccStrip();
+ TQString str = mOrigMsg->ccStrip();
body.append( getFName( str ) );
}
@@ -545,7 +545,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OCCLNAME" << endl;
i += strlen( "OCCLNAME" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->ccStrip();
+ TQString str = mOrigMsg->ccStrip();
body.append( getLName( str ) );
}
@@ -553,7 +553,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OTOADDR" << endl;
i += strlen( "OTOADDR" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->to();
+ TQString str = mOrigMsg->to();
body.append( str );
}
@@ -561,7 +561,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OTONAME" << endl;
i += strlen( "OTONAME" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->toStrip();
+ TQString str = mOrigMsg->toStrip();
body.append( str );
}
@@ -569,7 +569,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OTOFNAME" << endl;
i += strlen( "OTOFNAME" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->toStrip();
+ TQString str = mOrigMsg->toStrip();
body.append( getFName( str ) );
}
@@ -577,7 +577,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OTOLNAME" << endl;
i += strlen( "OTOLNAME" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->toStrip();
+ TQString str = mOrigMsg->toStrip();
body.append( getLName( str ) );
}
@@ -585,7 +585,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OTOLIST" << endl;
i += strlen( "OTOLIST" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->to();
+ TQString str = mOrigMsg->to();
body.append( str );
}
@@ -593,7 +593,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OTO" << endl;
i += strlen( "OTO" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->to();
+ TQString str = mOrigMsg->to();
body.append( str );
}
@@ -601,7 +601,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OFROMADDR" << endl;
i += strlen( "OFROMADDR" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->from();
+ TQString str = mOrigMsg->from();
body.append( str );
}
@@ -609,7 +609,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OFROMNAME" << endl;
i += strlen( "OFROMNAME" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->fromStrip();
+ TQString str = mOrigMsg->fromStrip();
body.append( str );
}
@@ -617,7 +617,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OFROMFNAME" << endl;
i += strlen( "OFROMFNAME" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->fromStrip();
+ TQString str = mOrigMsg->fromStrip();
body.append( getFName( str ) );
}
@@ -625,7 +625,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OFROMLNAME" << endl;
i += strlen( "OFROMLNAME" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->fromStrip();
+ TQString str = mOrigMsg->fromStrip();
body.append( getLName( str ) );
}
@@ -633,7 +633,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OFULLSUBJECT" << endl;
i += strlen( "OFULLSUBJECT" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->subject();
+ TQString str = mOrigMsg->subject();
body.append( str );
}
@@ -641,7 +641,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OFULLSUBJ" << endl;
i += strlen( "OFULLSUBJ" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->subject();
+ TQString str = mOrigMsg->subject();
body.append( str );
}
@@ -649,69 +649,69 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OMSGID" << endl;
i += strlen( "OMSGID" );
if ( mOrigMsg ) {
- QString str = mOrigMsg->id();
+ TQString str = mOrigMsg->id();
body.append( str );
}
} else if ( cmd.startsWith( "DATEEN" ) ) {
kdDebug() << "Command: DATEEN" << endl;
i += strlen( "DATEEN" );
- QDateTime date = QDateTime::currentDateTime();
+ TQDateTime date = TQDateTime::currentDateTime();
KLocale locale( "C" );
- QString str = locale.formatDate( date.date(), false );
+ TQString str = locale.formatDate( date.date(), false );
body.append( str );
} else if ( cmd.startsWith( "DATESHORT" ) ) {
kdDebug() << "Command: DATESHORT" << endl;
i += strlen( "DATESHORT" );
- QDateTime date = QDateTime::currentDateTime();
- QString str = KGlobal::locale()->formatDate( date.date(), true );
+ TQDateTime date = TQDateTime::currentDateTime();
+ TQString str = KGlobal::locale()->formatDate( date.date(), true );
body.append( str );
} else if ( cmd.startsWith( "DATE" ) ) {
kdDebug() << "Command: DATE" << endl;
i += strlen( "DATE" );
- QDateTime date = QDateTime::currentDateTime();
- QString str = KGlobal::locale()->formatDate( date.date(), false );
+ TQDateTime date = TQDateTime::currentDateTime();
+ TQString str = KGlobal::locale()->formatDate( date.date(), false );
body.append( str );
} else if ( cmd.startsWith( "DOW" ) ) {
kdDebug() << "Command: DOW" << endl;
i += strlen( "DOW" );
- QDateTime date = QDateTime::currentDateTime();
- QString str = KGlobal::locale()->calendar()->weekDayName( date.date(), false );
+ TQDateTime date = TQDateTime::currentDateTime();
+ TQString str = KGlobal::locale()->calendar()->weekDayName( date.date(), false );
body.append( str );
} else if ( cmd.startsWith( "TIMELONGEN" ) ) {
kdDebug() << "Command: TIMELONGEN" << endl;
i += strlen( "TIMELONGEN" );
- QDateTime date = QDateTime::currentDateTime();
+ TQDateTime date = TQDateTime::currentDateTime();
KLocale locale( "C");
- QString str = locale.formatTime( date.time(), true );
+ TQString str = locale.formatTime( date.time(), true );
body.append( str );
} else if ( cmd.startsWith( "TIMELONG" ) ) {
kdDebug() << "Command: TIMELONG" << endl;
i += strlen( "TIMELONG" );
- QDateTime date = QDateTime::currentDateTime();
- QString str = KGlobal::locale()->formatTime( date.time(), true );
+ TQDateTime date = TQDateTime::currentDateTime();
+ TQString str = KGlobal::locale()->formatTime( date.time(), true );
body.append( str );
} else if ( cmd.startsWith( "TIME" ) ) {
kdDebug() << "Command: TIME" << endl;
i += strlen( "TIME" );
- QDateTime date = QDateTime::currentDateTime();
- QString str = KGlobal::locale()->formatTime( date.time(), false );
+ TQDateTime date = TQDateTime::currentDateTime();
+ TQString str = KGlobal::locale()->formatTime( date.time(), false );
body.append( str );
} else if ( cmd.startsWith( "ODATEEN" ) ) {
kdDebug() << "Command: ODATEEN" << endl;
i += strlen( "ODATEEN" );
if ( mOrigMsg ) {
- QDateTime date;
+ TQDateTime date;
date.setTime_t( mOrigMsg->date() );
KLocale locale( "C");
- QString str = locale.formatDate( date.date(), false );
+ TQString str = locale.formatDate( date.date(), false );
body.append( str );
}
@@ -719,9 +719,9 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: ODATESHORT" << endl;
i += strlen( "ODATESHORT");
if ( mOrigMsg ) {
- QDateTime date;
+ TQDateTime date;
date.setTime_t( mOrigMsg->date() );
- QString str = KGlobal::locale()->formatDate( date.date(), true );
+ TQString str = KGlobal::locale()->formatDate( date.date(), true );
body.append( str );
}
@@ -729,9 +729,9 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: ODATE" << endl;
i += strlen( "ODATE");
if ( mOrigMsg ) {
- QDateTime date;
+ TQDateTime date;
date.setTime_t( mOrigMsg->date() );
- QString str = KGlobal::locale()->formatDate( date.date(), false );
+ TQString str = KGlobal::locale()->formatDate( date.date(), false );
body.append( str );
}
@@ -739,9 +739,9 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: ODOW" << endl;
i += strlen( "ODOW");
if ( mOrigMsg ) {
- QDateTime date;
+ TQDateTime date;
date.setTime_t( mOrigMsg->date() );
- QString str = KGlobal::locale()->calendar()->weekDayName( date.date(), false );
+ TQString str = KGlobal::locale()->calendar()->weekDayName( date.date(), false );
body.append( str );
}
@@ -749,10 +749,10 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OTIMELONGEN" << endl;
i += strlen( "OTIMELONGEN");
if ( mOrigMsg ) {
- QDateTime date;
+ TQDateTime date;
date.setTime_t( mOrigMsg->date() );
KLocale locale( "C");
- QString str = locale.formatTime( date.time(), true );
+ TQString str = locale.formatTime( date.time(), true );
body.append( str );
}
@@ -760,9 +760,9 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OTIMELONG" << endl;
i += strlen( "OTIMELONG");
if ( mOrigMsg ) {
- QDateTime date;
+ TQDateTime date;
date.setTime_t( mOrigMsg->date() );
- QString str = KGlobal::locale()->formatTime( date.time(), true );
+ TQString str = KGlobal::locale()->formatTime( date.time(), true );
body.append( str );
}
@@ -770,9 +770,9 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
kdDebug() << "Command: OTIME" << endl;
i += strlen( "OTIME");
if ( mOrigMsg ) {
- QDateTime date;
+ TQDateTime date;
date.setTime_t( mOrigMsg->date() );
- QString str = KGlobal::locale()->formatTime( date.time(), false );
+ TQString str = KGlobal::locale()->formatTime( date.time(), false );
body.append( str );
}
@@ -832,7 +832,7 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
// kdDebug() << "Message body: " << body << endl;
if ( mAppend ) {
- QCString msg_body = mMsg->body();
+ TQCString msg_body = mMsg->body();
msg_body.append( body.utf8() );
mMsg->setBody( msg_body );
} else {
@@ -840,10 +840,10 @@ void TemplateParser::processWithTemplate( const QString &tmpl )
}
}
-QString TemplateParser::findCustomTemplate( const QString &tmplName )
+TQString TemplateParser::findCustomTemplate( const TQString &tmplName )
{
CTemplates t( tmplName );
- QString content = t.content();
+ TQString content = t.content();
if ( !content.isEmpty() ) {
return content;
} else {
@@ -851,7 +851,7 @@ QString TemplateParser::findCustomTemplate( const QString &tmplName )
}
}
-QString TemplateParser::findTemplate()
+TQString TemplateParser::findTemplate()
{
// import 'Phrases' if it not done yet
if ( !GlobalSettings::self()->phrasesConverted() ) {
@@ -860,7 +860,7 @@ QString TemplateParser::findTemplate()
// kdDebug() << "Trying to find template for mode " << mode << endl;
- QString tmpl;
+ TQString tmpl;
if ( !mFolder ) { // find folder message belongs to
mFolder = mMsg->parent();
@@ -877,7 +877,7 @@ QString TemplateParser::findTemplate()
if ( mFolder ) // only if a folder was found
{
- QString fid = mFolder->idString();
+ TQString fid = mFolder->idString();
Templates fconf( fid );
if ( fconf.useCustomTemplates() ) { // does folder use custom templates?
switch( mMode ) {
@@ -916,9 +916,9 @@ QString TemplateParser::findTemplate()
}
kdDebug(5006) << "Identity found: " << mIdentity << endl;
- QString iid;
+ TQString iid;
if ( mIdentity ) {
- iid = QString("IDENTITY_%1").arg( mIdentity ); // templates ID for that identity
+ iid = TQString("IDENTITY_%1").arg( mIdentity ); // templates ID for that identity
}
else {
iid = "IDENTITY_NO_IDENTITY"; // templates ID for no identity
@@ -971,25 +971,25 @@ QString TemplateParser::findTemplate()
return tmpl;
}
-QString TemplateParser::pipe( const QString &cmd, const QString &buf )
+TQString TemplateParser::pipe( const TQString &cmd, const TQString &buf )
{
mPipeOut = "";
mPipeErr = "";
mPipeRc = 0;
KProcess proc;
- QCString data = buf.local8Bit();
+ TQCString data = buf.local8Bit();
// kdDebug() << "Command data: " << data << endl;
proc << KShell::splitArgs( cmd, KShell::TildeExpand );
proc.setUseShell( true );
- connect( &proc, SIGNAL( receivedStdout( KProcess *, char *, int ) ),
- this, SLOT( onReceivedStdout( KProcess *, char *, int ) ) );
- connect( &proc, SIGNAL( receivedStderr( KProcess *, char *, int ) ),
- this, SLOT( onReceivedStderr( KProcess *, char *, int ) ) );
- connect( &proc, SIGNAL( wroteStdin( KProcess * ) ),
- this, SLOT( onWroteStdin( KProcess * ) ) );
+ connect( &proc, TQT_SIGNAL( receivedStdout( KProcess *, char *, int ) ),
+ this, TQT_SLOT( onReceivedStdout( KProcess *, char *, int ) ) );
+ connect( &proc, TQT_SIGNAL( receivedStderr( KProcess *, char *, int ) ),
+ this, TQT_SLOT( onReceivedStderr( KProcess *, char *, int ) ) );
+ connect( &proc, TQT_SIGNAL( wroteStdin( KProcess * ) ),
+ this, TQT_SLOT( onWroteStdin( KProcess * ) ) );
if ( proc.start( KProcess::NotifyOnExit, KProcess::All ) ) {
@@ -1076,13 +1076,13 @@ void TemplateParser::onProcessExited( KProcess *proc )
void TemplateParser::onReceivedStdout( KProcess *proc, char *buffer, int buflen )
{
Q_UNUSED( proc );
- mPipeOut += QString::fromLocal8Bit( buffer, buflen );
+ mPipeOut += TQString::fromLocal8Bit( buffer, buflen );
}
void TemplateParser::onReceivedStderr( KProcess *proc, char *buffer, int buflen )
{
Q_UNUSED( proc );
- mPipeErr += QString::fromLocal8Bit( buffer, buflen );
+ mPipeErr += TQString::fromLocal8Bit( buffer, buflen );
}
void TemplateParser::onWroteStdin( KProcess *proc )