summaryrefslogtreecommitdiffstats
path: root/kmail/headerstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/headerstyle.cpp')
-rw-r--r--kmail/headerstyle.cpp252
1 files changed, 126 insertions, 126 deletions
diff --git a/kmail/headerstyle.cpp b/kmail/headerstyle.cpp
index 26e615d9..9e6e6315 100644
--- a/kmail/headerstyle.cpp
+++ b/kmail/headerstyle.cpp
@@ -57,12 +57,12 @@ using namespace KPIM;
#include <kabc/stdaddressbook.h>
#include <kabc/addresseelist.h>
#include <kmdcodec.h>
-#include <qdatetime.h>
-#include <qbuffer.h>
-#include <qbitmap.h>
-#include <qimage.h>
-#include <qapplication.h>
-#include <qregexp.h>
+#include <tqdatetime.h>
+#include <tqbuffer.h>
+#include <tqbitmap.h>
+#include <tqimage.h>
+#include <tqapplication.h>
+#include <tqregexp.h>
#include <kstandarddirs.h>
@@ -71,7 +71,7 @@ namespace KMail {
//
// Convenience functions:
//
- static inline QString directionOf( const QString & str ) {
+ static inline TQString directionOf( const TQString & str ) {
return str.isRightToLeft() ? "rtl" : "ltr" ;
}
@@ -79,9 +79,9 @@ namespace KMail {
// Converts to html. Changes URLs into href's, escapes HTML special
// chars and inserts the result into an <div> or <span> tag with
// "dir" set to "rtl" or "ltr" depending on the direction of @p str.
- static QString convertToHtmlBlock( const QString & str, bool useSpan=false ) {
- QString dir = directionOf( str );
- QString format = "<%1 dir=\"%3\">%4</%2>";
+ static TQString convertToHtmlBlock( const TQString & str, bool useSpan=false ) {
+ TQString dir = directionOf( str );
+ TQString format = "<%1 dir=\"%3\">%4</%2>";
return format.arg( useSpan ? "span" : "div" )
.arg( useSpan ? "span" : "div" )
.arg( dir )
@@ -90,7 +90,7 @@ namespace KMail {
#endif
// ### tmp wrapper to make kmreaderwin code working:
- static QString strToHtml( const QString & str,
+ static TQString strToHtml( const TQString & str,
int flags = LinkLocator::PreserveSpaces ) {
return LinkLocator::convertToHtml( str, flags );
}
@@ -111,21 +111,21 @@ namespace KMail {
const HeaderStyle * next() const { return plain(); }
const HeaderStyle * prev() const { return fancy(); }
- QString format( const KMMessage * message, const HeaderStrategy * strategy,
- const QString & vCardName, bool printing, bool topLevel ) const;
+ TQString format( const KMMessage * message, const HeaderStrategy * strategy,
+ const TQString & vCardName, bool printing, bool topLevel ) const;
};
- QString BriefHeaderStyle::format( const KMMessage * message,
+ TQString BriefHeaderStyle::format( const KMMessage * message,
const HeaderStrategy * strategy,
- const QString & vCardName, bool printing, bool topLevel ) const {
- if ( !message ) return QString::null;
+ const TQString & vCardName, bool printing, bool topLevel ) const {
+ if ( !message ) return TQString::null;
if ( !strategy )
strategy = HeaderStrategy::brief();
// The direction of the header is determined according to the direction
// of the application layout.
- QString dir = QApplication::reverseLayout() ? "rtl" : "ltr" ;
+ TQString dir = TQApplication::reverseLayout() ? "rtl" : "ltr" ;
// However, the direction of the message subject within the header is
// determined according to the contents of the subject itself. Since
@@ -133,16 +133,16 @@ namespace KMail {
// considered left-to-right, they are ignored when determining its
// direction.
- QString subjectDir;
+ TQString subjectDir;
if (!message->subject().isEmpty())
subjectDir = directionOf( message->cleanSubject() );
else
subjectDir = directionOf( i18n("No Subject") );
// Prepare the date string (when printing always use the localized date)
- QString dateString;
+ TQString dateString;
if( printing ) {
- QDateTime dateTime;
+ TQDateTime dateTime;
KLocale * locale = KGlobal::locale();
dateTime.setTime_t( message->date() );
dateString = locale->formatDateTime( dateTime );
@@ -150,7 +150,7 @@ namespace KMail {
dateString = message->dateStr();
}
- QString headerStr = "<div class=\"header\" dir=\"" + dir + "\">\n";
+ TQString headerStr = "<div class=\"header\" dir=\"" + dir + "\">\n";
if ( strategy->showHeader( "subject" ) )
headerStr += "<div dir=\"" + subjectDir + "\">\n"
@@ -158,13 +158,13 @@ namespace KMail {
strToHtml( message->subject() ) +
"</b></div>\n";
- QStringList headerParts;
+ TQStringList headerParts;
if ( strategy->showHeader( "from" ) ) {
- QString fromStr = message->from();
+ TQString fromStr = message->from();
if ( fromStr.isEmpty() ) // no valid email in from, maybe just a name
fromStr = message->fromStrip(); // let's use that
- QString fromPart = KMMessage::emailAddrAsAnchor( fromStr, true );
+ TQString fromPart = KMMessage::emailAddrAsAnchor( fromStr, true );
if ( !vCardName.isEmpty() )
fromPart += "&nbsp;&nbsp;<a href=\"" + vCardName + "\">" + i18n("[vCard]") + "</a>";
headerParts << fromPart;
@@ -180,7 +180,7 @@ namespace KMail {
headerParts << strToHtml(message->dateShortStr());
// remove all empty (modulo whitespace) entries and joins them via ", \n"
- headerStr += " (" + headerParts.grep( QRegExp( "\\S" ) ).join( ",\n" ) + ')';
+ headerStr += " (" + headerParts.grep( TQRegExp( "\\S" ) ).join( ",\n" ) + ')';
headerStr += "</div>\n";
@@ -206,24 +206,24 @@ namespace KMail {
const HeaderStyle * next() const { return fancy(); }
const HeaderStyle * prev() const { return brief(); }
- QString format( const KMMessage * message, const HeaderStrategy * strategy,
- const QString & vCardName, bool printing, bool topLevel ) const;
+ TQString format( const KMMessage * message, const HeaderStrategy * strategy,
+ const TQString & vCardName, bool printing, bool topLevel ) const;
private:
- QString formatAllMessageHeaders( const KMMessage * message ) const;
+ TQString formatAllMessageHeaders( const KMMessage * message ) const;
};
- QString PlainHeaderStyle::format( const KMMessage * message,
+ TQString PlainHeaderStyle::format( const KMMessage * message,
const HeaderStrategy * strategy,
- const QString & vCardName, bool printing, bool topLevel ) const {
- if ( !message ) return QString::null;
+ const TQString & vCardName, bool printing, bool topLevel ) const {
+ if ( !message ) return TQString::null;
if ( !strategy )
strategy = HeaderStrategy::rich();
// The direction of the header is determined according to the direction
// of the application layout.
- QString dir = ( QApplication::reverseLayout() ? "rtl" : "ltr" );
+ TQString dir = ( TQApplication::reverseLayout() ? "rtl" : "ltr" );
// However, the direction of the message subject within the header is
// determined according to the contents of the subject itself. Since
@@ -231,16 +231,16 @@ namespace KMail {
// considered left-to-right, they are ignored when determining its
// direction.
- QString subjectDir;
+ TQString subjectDir;
if (!message->subject().isEmpty())
subjectDir = directionOf( message->cleanSubject() );
else
subjectDir = directionOf( i18n("No Subject") );
// Prepare the date string (when printing always use the localized date)
- QString dateString;
+ TQString dateString;
if( printing ) {
- QDateTime dateTime;
+ TQDateTime dateTime;
KLocale* locale = KGlobal::locale();
dateTime.setTime_t( message->date() );
dateString = locale->formatDateTime( dateTime );
@@ -249,22 +249,22 @@ namespace KMail {
dateString = message->dateStr();
}
- QString headerStr;
+ TQString headerStr;
if ( strategy->headersToDisplay().isEmpty()
&& strategy->defaultPolicy() == HeaderStrategy::Display ) {
// crude way to emulate "all" headers - Note: no strings have
// i18n(), so direction should always be ltr.
- headerStr= QString("<div class=\"header\" dir=\"ltr\">");
+ headerStr= TQString("<div class=\"header\" dir=\"ltr\">");
headerStr += formatAllMessageHeaders( message );
return headerStr + "</div>";
}
- headerStr = QString("<div class=\"header\" dir=\"%1\">").arg(dir);
+ headerStr = TQString("<div class=\"header\" dir=\"%1\">").arg(dir);
//case HdrLong:
if ( strategy->showHeader( "subject" ) )
- headerStr += QString("<div dir=\"%1\"><b style=\"font-size:130%\">" +
+ headerStr += TQString("<div dir=\"%1\"><b style=\"font-size:130%\">" +
strToHtml(message->subject()) + "</b></div>\n")
.arg(subjectDir);
@@ -273,8 +273,8 @@ namespace KMail {
#if 0
// Get Instant Messaging presence
- QString presence;
- QString kabcUid;
+ TQString presence;
+ TQString kabcUid;
if ( strategy->showHeader( "status" ) )
{
KABC::AddressBook *addressBook = KABC::StdAddressBook::self( true );
@@ -286,7 +286,7 @@ namespace KMail {
#endif
if ( strategy->showHeader( "from" ) ) {
- QString fromStr = message->from();
+ TQString fromStr = message->from();
if ( fromStr.isEmpty() ) // no valid email in from, maybe just a name
fromStr = message->fromStrip(); // let's use that
headerStr.append(i18n("From: ") +
@@ -327,9 +327,9 @@ namespace KMail {
return headerStr;
}
- QString PlainHeaderStyle::formatAllMessageHeaders( const KMMessage * message ) const {
+ TQString PlainHeaderStyle::formatAllMessageHeaders( const KMMessage * message ) const {
const DwHeaders & headers = message->headers();
- QString result;
+ TQString result;
for ( const DwField * field = headers.FirstField() ; field ; field = field->Next() ) {
result += ( field->FieldNameStr() + ": " ).c_str();
@@ -356,20 +356,20 @@ namespace KMail {
const HeaderStyle * next() const { return enterprise(); }
const HeaderStyle * prev() const { return plain(); }
- QString format( const KMMessage * message, const HeaderStrategy * strategy,
- const QString & vCardName, bool printing, bool topLevel ) const;
- static QString imgToDataUrl( const QImage & image,
+ TQString format( const KMMessage * message, const HeaderStrategy * strategy,
+ const TQString & vCardName, bool printing, bool topLevel ) const;
+ static TQString imgToDataUrl( const TQImage & image,
const char *fmt = "PNG" );
private:
- static QString drawSpamMeter( double percent, const QString & filterHeader );
+ static TQString drawSpamMeter( double percent, const TQString & filterHeader );
};
- QString FancyHeaderStyle::drawSpamMeter( double percent,
- const QString & filterHeader )
+ TQString FancyHeaderStyle::drawSpamMeter( double percent,
+ const TQString & filterHeader )
{
- QImage meterBar( 20, 1, 8, 24 );
+ TQImage meterBar( 20, 1, 8, 24 );
const unsigned short gradient[20][3] = {
{ 0, 255, 0 },
{ 27, 254, 0 },
@@ -405,18 +405,18 @@ namespace KMail {
meterBar.setPixel( i, 0, i+1 );
}
}
- QString titleText = i18n("%1% probability of being spam.\n\nFull report:\n%2")
- .arg( QString::number( percent ), filterHeader );
- return QString("<img src=\"%1\" width=\"%2\" height=\"%3\" style=\"border: 1px solid black;\" title=\"%4\"> &nbsp;")
- .arg( imgToDataUrl( meterBar, "PPM" ), QString::number( 20 ),
- QString::number( 5 ), titleText );
+ TQString titleText = i18n("%1% probability of being spam.\n\nFull report:\n%2")
+ .arg( TQString::number( percent ), filterHeader );
+ return TQString("<img src=\"%1\" width=\"%2\" height=\"%3\" style=\"border: 1px solid black;\" title=\"%4\"> &nbsp;")
+ .arg( imgToDataUrl( meterBar, "PPM" ), TQString::number( 20 ),
+ TQString::number( 5 ), titleText );
}
- QString FancyHeaderStyle::format( const KMMessage * message,
+ TQString FancyHeaderStyle::format( const KMMessage * message,
const HeaderStrategy * strategy,
- const QString & vCardName, bool printing, bool topLevel ) const {
- if ( !message ) return QString::null;
+ const TQString & vCardName, bool printing, bool topLevel ) const {
+ if ( !message ) return TQString::null;
if ( !strategy )
strategy = HeaderStrategy::rich();
@@ -426,8 +426,8 @@ namespace KMail {
// The direction of the header is determined according to the direction
// of the application layout.
- QString dir = ( QApplication::reverseLayout() ? "rtl" : "ltr" );
- QString headerStr = QString("<div class=\"fancy header\" dir=\"%1\">\n").arg(dir);
+ TQString dir = ( TQApplication::reverseLayout() ? "rtl" : "ltr" );
+ TQString headerStr = TQString("<div class=\"fancy header\" dir=\"%1\">\n").arg(dir);
// However, the direction of the message subject within the header is
// determined according to the contents of the subject itself. Since
@@ -435,16 +435,16 @@ namespace KMail {
// considered left-to-right, they are ignored when determining its
// direction.
- QString subjectDir;
+ TQString subjectDir;
if ( !message->subject().isEmpty() )
subjectDir = directionOf( message->cleanSubject() );
else
subjectDir = directionOf( i18n("No Subject") );
// Prepare the date string (when printing always use the localized date)
- QString dateString;
+ TQString dateString;
if( printing ) {
- QDateTime dateTime;
+ TQDateTime dateTime;
KLocale* locale = KGlobal::locale();
dateTime.setTime_t( message->date() );
dateString = locale->formatDateTime( dateTime );
@@ -458,7 +458,7 @@ namespace KMail {
// from a few spam filters and try to create visually meaningful graphics
// out of the spam scores.
- QString spamHTML;
+ TQString spamHTML;
if ( configReader.readBoolEntry( "showSpamStatus", true ) ) {
SpamScores scores = SpamHeaderAnalyzer::getSpamScores( message );
@@ -467,17 +467,17 @@ namespace KMail {
drawSpamMeter( (*it).score(), (*it).spamHeader() );
}
- QString userHTML;
- QString presence;
+ TQString userHTML;
+ TQString presence;
// IM presence and kabc photo
::KIMProxy *imProxy = KMKernel::self()->imProxy();
- QString kabcUid;
+ TQString kabcUid;
KABC::AddressBook *addressBook = KABC::StdAddressBook::self( true );
KABC::AddresseeList addresses = addressBook->findByEmail( KPIM::getFirstEmailAddress( message->from() ) );
- QString photoURL;
+ TQString photoURL;
int photoWidth = 60;
int photoHeight = 60;
if( addresses.count() == 1 )
@@ -490,7 +490,7 @@ namespace KMail {
presence = imProxy->presenceString( kabcUid );
if ( !presence.isEmpty() )
{
- QString presenceIcon = QString::fromLatin1( " <img src=\"%1\"/>" )
+ TQString presenceIcon = TQString::fromLatin1( " <img src=\"%1\"/>" )
.arg( imgToDataUrl( imProxy->presenceIcon( kabcUid ).convertToImage() ) );
presence += presenceIcon;
}
@@ -500,7 +500,7 @@ namespace KMail {
{
// get photo data and convert to data: url
//kdDebug( 5006 ) << "INTERNAL photo found" << endl;
- QImage photo = addresses[0].photo().data();
+ TQImage photo = addresses[0].photo().data();
if ( !photo.isNull() )
{
photoWidth = photo.width();
@@ -531,20 +531,20 @@ namespace KMail {
if( photoURL.isEmpty() ) {
// no photo, look for a Face header
- QString faceheader = message->headerField( "Face" );
+ TQString faceheader = message->headerField( "Face" );
if ( !faceheader.isEmpty() ) {
- QImage faceimage;
+ TQImage faceimage;
kdDebug( 5006 ) << "Found Face: header" << endl;
- QCString facestring = faceheader.utf8();
+ TQCString facestring = faceheader.utf8();
// Spec says header should be less than 998 bytes
// Face: is 5 characters
if ( facestring.length() < 993 ) {
- QByteArray facearray;
+ TQByteArray facearray;
KCodecs::base64Decode(facestring, facearray);
- QImage faceimage;
+ TQImage faceimage;
if ( faceimage.loadFromData( facearray, "png" ) ) {
// Spec says image must be 48x48 pixels
if ( (48 == faceimage.width()) && (48 == faceimage.height()) ) {
@@ -566,8 +566,8 @@ namespace KMail {
if( photoURL.isEmpty() )
{
// no photo, look for a X-Face header
- QString xfaceURL;
- QString xfhead = message->headerField( "X-Face" );
+ TQString xfaceURL;
+ TQString xfhead = message->headerField( "X-Face" );
if ( !xfhead.isEmpty() )
{
KXFace xf;
@@ -581,12 +581,12 @@ namespace KMail {
if( !photoURL.isEmpty() )
{
//kdDebug( 5006 ) << "Got a photo: " << photoURL << endl;
- userHTML = QString("<img src=\"%1\" width=\"%2\" height=\"%3\">")
+ userHTML = TQString("<img src=\"%1\" width=\"%2\" height=\"%3\">")
.arg( photoURL ).arg( photoWidth ).arg( photoHeight );
if ( presence.isEmpty() ) {
- userHTML = QString("<div class=\"senderpic\">") + userHTML + "</div>";
+ userHTML = TQString("<div class=\"senderpic\">") + userHTML + "</div>";
} else {
- userHTML = QString( "<div class=\"senderpic\">"
+ userHTML = TQString( "<div class=\"senderpic\">"
"<a href=\"im:%1\">%2<div class=\"senderstatus\">"
"<span name=\"presence-%3\">%4</span></div></a>"
"</div>" ).arg( kabcUid )
@@ -597,7 +597,7 @@ namespace KMail {
} else {
// we don't have a photo, just show presence, if we have it
if ( !presence.isEmpty() )
- userHTML = QString( "<a href=\"im:%1\"><div class=\"senderstatus\">"
+ userHTML = TQString( "<a href=\"im:%1\"><div class=\"senderstatus\">"
"<span name=\"presence-%2\">%3</span></div></a>" )
.arg( kabcUid )
.arg( kabcUid )
@@ -619,7 +619,7 @@ namespace KMail {
const int flags = LinkLocator::PreserveSpaces |
( GlobalSettings::self()->showEmoticons() ?
LinkLocator::ReplaceSmileys : 0 );
- headerStr += QString("<div dir=\"%1\">%2</div>\n")
+ headerStr += TQString("<div dir=\"%1\">%2</div>\n")
.arg(subjectDir)
.arg(message->subject().isEmpty()?
i18n("No Subject") :
@@ -629,12 +629,12 @@ namespace KMail {
//headerStr += "<table>\n";
// from line
// the mailto: URLs can contain %3 etc., therefore usage of multiple
- // QString::arg is not possible
+ // TQString::arg is not possible
if ( strategy->showHeader( "from" ) ) {
- QString fromStr = message->from();
+ TQString fromStr = message->from();
if ( fromStr.isEmpty() ) // no valid email in from, maybe just a name
fromStr = message->fromStrip(); // let's use that
- headerStr += QString("<tr><th>%1</th>\n"
+ headerStr += TQString("<tr><th>%1</th>\n"
"<td>")
.arg(i18n("From: "))
+ KMMessage::emailAddrAsAnchor( fromStr, false )
@@ -642,17 +642,17 @@ namespace KMail {
+ i18n("(resent from %1)")
.arg( KMMessage::emailAddrAsAnchor(
message->headerField( "Resent-From" ),false) )
- : QString("") )
+ : TQString("") )
+ ( !vCardName.isEmpty() ? "&nbsp;&nbsp;<a href=\"" + vCardName + "\">"
+ i18n("[vCard]") + "</a>"
- : QString("") )
+ : TQString("") )
#if 0
+ ( ( !presence.isEmpty() )
? "&nbsp;&nbsp;(<span name=\"presence-" + kabcUid + "\">" + presence + "</span>)"
- : QString("") )
+ : TQString("") )
#endif
+ ( message->headerField("Organization").isEmpty()
- ? QString("")
+ ? TQString("")
: "&nbsp;&nbsp;("
+ strToHtml(message->headerField("Organization"))
+ ")")
@@ -660,27 +660,27 @@ namespace KMail {
}
// to line
if ( strategy->showHeader( "to" ) )
- headerStr.append(QString("<tr><th>%1</th>\n"
+ headerStr.append(TQString("<tr><th>%1</th>\n"
"<td>%2</td></tr>\n")
.arg(i18n("To: "))
.arg(KMMessage::emailAddrAsAnchor(message->to(),false)));
// cc line, if any
if ( strategy->showHeader( "cc" ) && !message->cc().isEmpty())
- headerStr.append(QString("<tr><th>%1</th>\n"
+ headerStr.append(TQString("<tr><th>%1</th>\n"
"<td>%2</td></tr>\n")
.arg(i18n("CC: "))
.arg(KMMessage::emailAddrAsAnchor(message->cc(),false)));
// Bcc line, if any
if ( strategy->showHeader( "bcc" ) && !message->bcc().isEmpty())
- headerStr.append(QString("<tr><th>%1</th>\n"
+ headerStr.append(TQString("<tr><th>%1</th>\n"
"<td>%2</td></tr>\n")
.arg(i18n("BCC: "))
.arg(KMMessage::emailAddrAsAnchor(message->bcc(),false)));
if ( strategy->showHeader( "date" ) )
- headerStr.append(QString("<tr><th>%1</th>\n"
+ headerStr.append(TQString("<tr><th>%1</th>\n"
"<td dir=\"%2\">%3</td></tr>\n")
.arg(i18n("Date: "))
.arg( directionOf( message->dateStr() ) )
@@ -689,7 +689,7 @@ namespace KMail {
if ( GlobalSettings::self()->showUserAgent() ) {
if ( strategy->showHeader( "user-agent" ) ) {
if ( !message->headerField("User-Agent").isEmpty() ) {
- headerStr.append(QString("<tr><th>%1</th>\n"
+ headerStr.append(TQString("<tr><th>%1</th>\n"
"<td>%2</td></tr>\n")
.arg(i18n("User-Agent: "))
.arg( strToHtml( message->headerField("User-Agent") ) ) );
@@ -698,7 +698,7 @@ namespace KMail {
if ( strategy->showHeader( "x-mailer" ) ) {
if ( !message->headerField("X-Mailer").isEmpty() ) {
- headerStr.append(QString("<tr><th>%1</th>\n"
+ headerStr.append(TQString("<tr><th>%1</th>\n"
"<td>%2</td></tr>\n")
.arg(i18n("X-Mailer: "))
.arg( strToHtml( message->headerField("X-Mailer") ) ) );
@@ -708,31 +708,31 @@ namespace KMail {
// FIXME: Show status in synthetic header style field. Decide whether this or current in brackets style is best and remove one.
/* if( strategy->showHeader( "status" ) )
- headerStr.append( QString( "<tr><th>%1</th>\n"
+ headerStr.append( TQString( "<tr><th>%1</th>\n"
"<td dir=\"%2\">%3</td></tr>\n")
.arg(i18n("Sender status: "))
.arg( directionOf( onlineStatus ) )
.arg(onlineStatus));
*/
- headerStr.append( QString("<tr><td colspan=\"2\"><div id=\"attachmentInjectionPoint\"></div></td></tr>" ) );
+ headerStr.append( TQString("<tr><td colspan=\"2\"><div id=\"attachmentInjectionPoint\"></div></td></tr>" ) );
headerStr.append(
- QString( "</table></td><td align=\"center\">%1</td></tr></table>\n" ).arg(userHTML) );
+ TQString( "</table></td><td align=\"center\">%1</td></tr></table>\n" ).arg(userHTML) );
if ( !spamHTML.isEmpty() )
- headerStr.append( QString( "<div class=\"spamheader\" dir=\"%1\"><b>%2</b>&nbsp;<span style=\"padding-left: 20px;\">%3</span></div>\n")
+ headerStr.append( TQString( "<div class=\"spamheader\" dir=\"%1\"><b>%2</b>&nbsp;<span style=\"padding-left: 20px;\">%3</span></div>\n")
.arg( subjectDir, i18n("Spam Status:"), spamHTML ) );
headerStr += "</div>\n\n";
return headerStr;
}
- QString FancyHeaderStyle::imgToDataUrl( const QImage &image, const char* fmt )
+ TQString FancyHeaderStyle::imgToDataUrl( const TQImage &image, const char* fmt )
{
- QByteArray ba;
- QBuffer buffer( ba );
+ TQByteArray ba;
+ TQBuffer buffer( ba );
buffer.open( IO_WriteOnly );
image.save( &buffer, fmt );
- return QString::fromLatin1("data:image/%1;base64,%2")
+ return TQString::fromLatin1("data:image/%1;base64,%2")
.arg( fmt, KCodecs::base64Encode( ba ) );
}
@@ -749,21 +749,21 @@ namespace KMail {
const HeaderStyle * next() const { return brief(); }
const HeaderStyle * prev() const { return fancy(); }
- QString format( const KMMessage * message, const HeaderStrategy * strategy,
- const QString & vCardName, bool printing, bool topLevel ) const;
+ TQString format( const KMMessage * message, const HeaderStrategy * strategy,
+ const TQString & vCardName, bool printing, bool topLevel ) const;
};
- QString EnterpriseHeaderStyle::format( const KMMessage * message,
+ TQString EnterpriseHeaderStyle::format( const KMMessage * message,
const HeaderStrategy * strategy,
- const QString & vCardName, bool printing, bool topLevel ) const {
- if ( !message ) return QString::null;
+ const TQString & vCardName, bool printing, bool topLevel ) const {
+ if ( !message ) return TQString::null;
if ( !strategy )
strategy = HeaderStrategy::brief();
// The direction of the header is determined according to the direction
// of the application layout.
- QString dir = QApplication::reverseLayout() ? "rtl" : "ltr" ;
+ TQString dir = TQApplication::reverseLayout() ? "rtl" : "ltr" ;
// However, the direction of the message subject within the header is
// determined according to the contents of the subject itself. Since
@@ -771,17 +771,17 @@ namespace KMail {
// considered left-to-right, they are ignored when determining its
// direction.
- QString subjectDir;
+ TQString subjectDir;
if (!message->subject().isEmpty())
subjectDir = directionOf( message->cleanSubject() );
else
subjectDir = directionOf( i18n("No Subject") );
// colors depend on if its encapsulated or not
- QColor fontColor(Qt::white);
- QString linkColor = "class =\"white\"";
- const QColor activeColor = qApp->palette().active().highlight();
- QColor activeColorDark = activeColor.dark(130);
+ TQColor fontColor(Qt::white);
+ TQString linkColor = "class =\"white\"";
+ const TQColor activeColor = qApp->palette().active().highlight();
+ TQColor activeColorDark = activeColor.dark(130);
// reverse colors for encapsulated
if( !topLevel ){
activeColorDark = activeColor.dark(50);
@@ -789,7 +789,7 @@ namespace KMail {
linkColor = "";
}
- QStringList headerParts;
+ TQStringList headerParts;
if( strategy->showHeader( "to" ) )
headerParts << KMMessage::emailAddrAsAnchor( message->to(), false, linkColor );
@@ -800,12 +800,12 @@ namespace KMail {
headerParts << i18n("BCC: ") + KMMessage::emailAddrAsAnchor( message->bcc(), true, linkColor );
// remove all empty (modulo whitespace) entries and joins them via ", \n"
- QString headerPart = " " + headerParts.grep( QRegExp( "\\S" ) ).join( ", " );
+ TQString headerPart = " " + headerParts.grep( TQRegExp( "\\S" ) ).join( ", " );
// Prepare the date string (when printing always use the localized date)
- QString dateString;
+ TQString dateString;
if( printing ) {
- QDateTime dateTime;
+ TQDateTime dateTime;
KLocale * locale = KGlobal::locale();
dateTime.setTime_t( message->date() );
dateString = locale->formatDateTime( dateTime );
@@ -813,10 +813,10 @@ namespace KMail {
dateString = message->dateStr();
}
- QString imgpath(locate("data","kmail/pics/"));
+ TQString imgpath(locate("data","kmail/pics/"));
imgpath.append("enterprise_");
- const QString borderSettings(" padding-top: 0px; padding-bottom: 0px; border-width: 0px ");
- QString headerStr ("");
+ const TQString borderSettings(" padding-top: 0px; padding-bottom: 0px; border-width: 0px ");
+ TQString headerStr ("");
// 3D borders
if(topLevel)
@@ -851,11 +851,11 @@ namespace KMail {
// from
if ( strategy->showHeader( "from" ) ){
- QString fromStr = message->from();
+ TQString fromStr = message->from();
if ( fromStr.isEmpty() ) // no valid email in from, maybe just a name
fromStr = message->fromStrip(); // let's use that
// TODO vcard
- QString fromPart = KMMessage::emailAddrAsAnchor( fromStr, true, linkColor );
+ TQString fromPart = KMMessage::emailAddrAsAnchor( fromStr, true, linkColor );
if ( !vCardName.isEmpty() )
fromPart += "&nbsp;&nbsp;<a href=\"" + vCardName + "\" "+linkColor+">" + i18n("[vCard]") + "</a>";
//TDDO strategy date
@@ -940,8 +940,8 @@ namespace KMail {
return 0; // make compiler happy
}
- const HeaderStyle * HeaderStyle::create( const QString & type ) {
- QString lowerType = type.lower();
+ const HeaderStyle * HeaderStyle::create( const TQString & type ) {
+ TQString lowerType = type.lower();
if ( lowerType == "brief" ) return brief();
if ( lowerType == "plain" ) return plain();
if ( lowerType == "enterprise" ) return enterprise();