From 7be55ffa061c026e35e2d6a0effe1161ddb0d41f Mon Sep 17 00:00:00 2001
From: tpearson
Date: Sat, 31 Jul 2010 19:53:50 +0000
Subject: Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
---
kmail/kmreaderwin.cpp | 472 +++++++++++++++++++++++++-------------------------
1 file changed, 236 insertions(+), 236 deletions(-)
(limited to 'kmail/kmreaderwin.cpp')
diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp
index c3030304..b5ee4105 100644
--- a/kmail/kmreaderwin.cpp
+++ b/kmail/kmreaderwin.cpp
@@ -110,14 +110,14 @@ using KMail::TeeHtmlWriter;
#include
#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
// X headers...
#undef Never
@@ -140,16 +140,16 @@ class NewByteArray : public QByteArray
public:
NewByteArray &appendNULL();
NewByteArray &operator+=( const char * );
- NewByteArray &operator+=( const QByteArray & );
- NewByteArray &operator+=( const QCString & );
- QByteArray& qByteArray();
+ NewByteArray &operator+=( const TQByteArray & );
+ NewByteArray &operator+=( const TQCString & );
+ TQByteArray& qByteArray();
};
NewByteArray& NewByteArray::appendNULL()
{
- QByteArray::detach();
+ TQByteArray::detach();
uint len1 = size();
- if ( !QByteArray::resize( len1 + 1 ) )
+ if ( !TQByteArray::resize( len1 + 1 ) )
return *this;
*(data() + len1) = '\0';
return *this;
@@ -158,41 +158,41 @@ NewByteArray& NewByteArray::operator+=( const char * newData )
{
if ( !newData )
return *this;
- QByteArray::detach();
+ TQByteArray::detach();
uint len1 = size();
uint len2 = qstrlen( newData );
- if ( !QByteArray::resize( len1 + len2 ) )
+ if ( !TQByteArray::resize( len1 + len2 ) )
return *this;
memcpy( data() + len1, newData, len2 );
return *this;
}
-NewByteArray& NewByteArray::operator+=( const QByteArray & newData )
+NewByteArray& NewByteArray::operator+=( const TQByteArray & newData )
{
if ( newData.isNull() )
return *this;
- QByteArray::detach();
+ TQByteArray::detach();
uint len1 = size();
uint len2 = newData.size();
- if ( !QByteArray::resize( len1 + len2 ) )
+ if ( !TQByteArray::resize( len1 + len2 ) )
return *this;
memcpy( data() + len1, newData.data(), len2 );
return *this;
}
-NewByteArray& NewByteArray::operator+=( const QCString & newData )
+NewByteArray& NewByteArray::operator+=( const TQCString & newData )
{
if ( newData.isEmpty() )
return *this;
- QByteArray::detach();
+ TQByteArray::detach();
uint len1 = size();
uint len2 = newData.length(); // forget about the trailing 0x00 !
- if ( !QByteArray::resize( len1 + len2 ) )
+ if ( !TQByteArray::resize( len1 + len2 ) )
return *this;
memcpy( data() + len1, newData.data(), len2 );
return *this;
}
-QByteArray& NewByteArray::qByteArray()
+TQByteArray& NewByteArray::qByteArray()
{
- return *((QByteArray*)this);
+ return *((TQByteArray*)this);
}
// This function returns the complete data that were in this
@@ -205,8 +205,8 @@ void KMReaderWin::objectTreeToDecryptedMsg( partNode* node,
bool weAreReplacingTheRootNode,
int recCount )
{
- kdDebug(5006) << QString("-------------------------------------------------" ) << endl;
- kdDebug(5006) << QString("KMReaderWin::objectTreeToDecryptedMsg( %1 ) START").arg( recCount ) << endl;
+ kdDebug(5006) << TQString("-------------------------------------------------" ) << endl;
+ kdDebug(5006) << TQString("KMReaderWin::objectTreeToDecryptedMsg( %1 ) START").arg( recCount ) << endl;
if( node ) {
partNode* curNode = node;
partNode* dataNode = curNode;
@@ -392,15 +392,15 @@ kdDebug(5006) << " new Content-Type = " << headers->ContentType(
// B) Store the body of this part.
if( headers && bIsMultipart && dataNode->firstChild() ) {
kdDebug(5006) << "is valid Multipart, processing children:" << endl;
- QCString boundary = headers->ContentType().Boundary().c_str();
+ TQCString boundary = headers->ContentType().Boundary().c_str();
curNode = dataNode->firstChild();
// store children of multipart
while( curNode ) {
kdDebug(5006) << "--boundary" << endl;
if( resultingData.size() &&
( '\n' != resultingData.at( resultingData.size()-1 ) ) )
- resultingData += QCString( "\n" );
- resultingData += QCString( "\n" );
+ resultingData += TQCString( "\n" );
+ resultingData += TQCString( "\n" );
resultingData += "--";
resultingData += boundary;
resultingData += "\n";
@@ -441,7 +441,7 @@ kdDebug(5006) << " Root node will NOT be replaced." << endl
recCount + 1 );
}
}
- kdDebug(5006) << QString("\nKMReaderWin::objectTreeToDecryptedMsg( %1 ) END").arg( recCount ) << endl;
+ kdDebug(5006) << TQString("\nKMReaderWin::objectTreeToDecryptedMsg( %1 ) END").arg( recCount ) << endl;
}
@@ -466,28 +466,28 @@ kdDebug(5006) << " Root node will NOT be replaced." << endl
void KMReaderWin::createWidgets() {
- QVBoxLayout * vlay = new QVBoxLayout( this );
- mSplitter = new QSplitter( Qt::Vertical, this, "mSplitter" );
+ TQVBoxLayout * vlay = new TQVBoxLayout( this );
+ mSplitter = new TQSplitter( Qt::Vertical, this, "mSplitter" );
vlay->addWidget( mSplitter );
mMimePartTree = new KMMimePartTree( this, mSplitter, "mMimePartTree" );
- mBox = new QHBox( mSplitter, "mBox" );
+ mBox = new TQHBox( mSplitter, "mBox" );
setStyleDependantFrameWidth();
mBox->setFrameStyle( mMimePartTree->frameStyle() );
mColorBar = new HtmlStatusBar( mBox, "mColorBar" );
mViewer = new KHTMLPart( mBox, "mViewer" );
mSplitter->setOpaqueResize( KGlobalSettings::opaqueResize() );
- mSplitter->setResizeMode( mMimePartTree, QSplitter::KeepSize );
+ mSplitter->setResizeMode( mMimePartTree, TQSplitter::KeepSize );
}
const int KMReaderWin::delay = 150;
//-----------------------------------------------------------------------------
-KMReaderWin::KMReaderWin(QWidget *aParent,
- QWidget *mainWindow,
+KMReaderWin::KMReaderWin(TQWidget *aParent,
+ TQWidget *mainWindow,
KActionCollection* actionCollection,
const char *aName,
int aFlags )
- : QWidget(aParent, aName, aFlags | Qt::WDestructiveClose),
+ : TQWidget(aParent, aName, aFlags | Qt::WDestructiveClose),
mAttachmentStrategy( 0 ),
mHeaderStrategy( 0 ),
mHeaderStyle( 0 ),
@@ -542,12 +542,12 @@ KMReaderWin::KMReaderWin(QWidget *aParent,
mLevelQuote = GlobalSettings::self()->collapseQuoteLevelSpin() - 1;
- connect( &mUpdateReaderWinTimer, SIGNAL(timeout()),
- this, SLOT(updateReaderWin()) );
- connect( &mResizeTimer, SIGNAL(timeout()),
- this, SLOT(slotDelayedResize()) );
- connect( &mDelayedMarkTimer, SIGNAL(timeout()),
- this, SLOT(slotTouchMessage()) );
+ connect( &mUpdateReaderWinTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(updateReaderWin()) );
+ connect( &mResizeTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(slotDelayedResize()) );
+ connect( &mDelayedMarkTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(slotTouchMessage()) );
}
@@ -562,46 +562,46 @@ void KMReaderWin::createActions( KActionCollection * ac ) {
new KActionMenu( i18n("View->", "&Headers"), ac, "view_headers" );
headerMenu->setToolTip( i18n("Choose display style of message headers") );
- connect( headerMenu, SIGNAL(activated()),
- this, SLOT(slotCycleHeaderStyles()) );
+ connect( headerMenu, TQT_SIGNAL(activated()),
+ this, TQT_SLOT(slotCycleHeaderStyles()) );
raction = new KRadioAction( i18n("View->headers->", "&Enterprise Headers"), 0,
- this, SLOT(slotEnterpriseHeaders()),
+ this, TQT_SLOT(slotEnterpriseHeaders()),
ac, "view_headers_enterprise" );
raction->setToolTip( i18n("Show the list of headers in Enterprise style") );
raction->setExclusiveGroup( "view_headers_group" );
headerMenu->insert(raction);
raction = new KRadioAction( i18n("View->headers->", "&Fancy Headers"), 0,
- this, SLOT(slotFancyHeaders()),
+ this, TQT_SLOT(slotFancyHeaders()),
ac, "view_headers_fancy" );
raction->setToolTip( i18n("Show the list of headers in a fancy format") );
raction->setExclusiveGroup( "view_headers_group" );
headerMenu->insert( raction );
raction = new KRadioAction( i18n("View->headers->", "&Brief Headers"), 0,
- this, SLOT(slotBriefHeaders()),
+ this, TQT_SLOT(slotBriefHeaders()),
ac, "view_headers_brief" );
raction->setToolTip( i18n("Show brief list of message headers") );
raction->setExclusiveGroup( "view_headers_group" );
headerMenu->insert( raction );
raction = new KRadioAction( i18n("View->headers->", "&Standard Headers"), 0,
- this, SLOT(slotStandardHeaders()),
+ this, TQT_SLOT(slotStandardHeaders()),
ac, "view_headers_standard" );
raction->setToolTip( i18n("Show standard list of message headers") );
raction->setExclusiveGroup( "view_headers_group" );
headerMenu->insert( raction );
raction = new KRadioAction( i18n("View->headers->", "&Long Headers"), 0,
- this, SLOT(slotLongHeaders()),
+ this, TQT_SLOT(slotLongHeaders()),
ac, "view_headers_long" );
raction->setToolTip( i18n("Show long list of message headers") );
raction->setExclusiveGroup( "view_headers_group" );
headerMenu->insert( raction );
raction = new KRadioAction( i18n("View->headers->", "&All Headers"), 0,
- this, SLOT(slotAllHeaders()),
+ this, TQT_SLOT(slotAllHeaders()),
ac, "view_headers_all" );
raction->setToolTip( i18n("Show all message headers") );
raction->setExclusiveGroup( "view_headers_group" );
@@ -611,32 +611,32 @@ void KMReaderWin::createActions( KActionCollection * ac ) {
KActionMenu *attachmentMenu =
new KActionMenu( i18n("View->", "&Attachments"), ac, "view_attachments" );
attachmentMenu->setToolTip( i18n("Choose display style of attachments") );
- connect( attachmentMenu, SIGNAL(activated()),
- this, SLOT(slotCycleAttachmentStrategy()) );
+ connect( attachmentMenu, TQT_SIGNAL(activated()),
+ this, TQT_SLOT(slotCycleAttachmentStrategy()) );
raction = new KRadioAction( i18n("View->attachments->", "&As Icons"), 0,
- this, SLOT(slotIconicAttachments()),
+ this, TQT_SLOT(slotIconicAttachments()),
ac, "view_attachments_as_icons" );
raction->setToolTip( i18n("Show all attachments as icons. Click to see them.") );
raction->setExclusiveGroup( "view_attachments_group" );
attachmentMenu->insert( raction );
raction = new KRadioAction( i18n("View->attachments->", "&Smart"), 0,
- this, SLOT(slotSmartAttachments()),
+ this, TQT_SLOT(slotSmartAttachments()),
ac, "view_attachments_smart" );
raction->setToolTip( i18n("Show attachments as suggested by sender.") );
raction->setExclusiveGroup( "view_attachments_group" );
attachmentMenu->insert( raction );
raction = new KRadioAction( i18n("View->attachments->", "&Inline"), 0,
- this, SLOT(slotInlineAttachments()),
+ this, TQT_SLOT(slotInlineAttachments()),
ac, "view_attachments_inline" );
raction->setToolTip( i18n("Show all attachments inline (if possible)") );
raction->setExclusiveGroup( "view_attachments_group" );
attachmentMenu->insert( raction );
raction = new KRadioAction( i18n("View->attachments->", "&Hide"), 0,
- this, SLOT(slotHideAttachments()),
+ this, TQT_SLOT(slotHideAttachments()),
ac, "view_attachments_hide" );
raction->setToolTip( i18n("Do not show attachments in the message viewer") );
raction->setExclusiveGroup( "view_attachments_group" );
@@ -644,48 +644,48 @@ void KMReaderWin::createActions( KActionCollection * ac ) {
// Set Encoding submenu
mSelectEncodingAction = new KSelectAction( i18n( "&Set Encoding" ), "charset", 0,
- this, SLOT( slotSetEncoding() ),
+ this, TQT_SLOT( slotSetEncoding() ),
ac, "encoding" );
- QStringList encodings = KMMsgBase::supportedEncodings( false );
+ TQStringList encodings = KMMsgBase::supportedEncodings( false );
encodings.prepend( i18n( "Auto" ) );
mSelectEncodingAction->setItems( encodings );
mSelectEncodingAction->setCurrentItem( 0 );
mMailToComposeAction = new KAction( i18n("New Message To..."), "mail_new",
- 0, this, SLOT(slotMailtoCompose()), ac,
+ 0, this, TQT_SLOT(slotMailtoCompose()), ac,
"mailto_compose" );
mMailToReplyAction = new KAction( i18n("Reply To..."), "mail_reply",
- 0, this, SLOT(slotMailtoReply()), ac,
+ 0, this, TQT_SLOT(slotMailtoReply()), ac,
"mailto_reply" );
mMailToForwardAction = new KAction( i18n("Forward To..."), "mail_forward",
- 0, this, SLOT(slotMailtoForward()), ac,
+ 0, this, TQT_SLOT(slotMailtoForward()), ac,
"mailto_forward" );
mAddAddrBookAction = new KAction( i18n("Add to Address Book"),
- 0, this, SLOT(slotMailtoAddAddrBook()),
+ 0, this, TQT_SLOT(slotMailtoAddAddrBook()),
ac, "add_addr_book" );
mOpenAddrBookAction = new KAction( i18n("Open in Address Book"),
- 0, this, SLOT(slotMailtoOpenAddrBook()),
+ 0, this, TQT_SLOT(slotMailtoOpenAddrBook()),
ac, "openin_addr_book" );
- mCopyAction = KStdAction::copy( this, SLOT(slotCopySelectedText()), ac, "kmail_copy");
+ mCopyAction = KStdAction::copy( this, TQT_SLOT(slotCopySelectedText()), ac, "kmail_copy");
mSelectAllAction = new KAction( i18n("Select All Text"), CTRL+SHIFT+Key_A, this,
- SLOT(selectAll()), ac, "mark_all_text" );
+ TQT_SLOT(selectAll()), ac, "mark_all_text" );
mCopyURLAction = new KAction( i18n("Copy Link Address"), 0, this,
- SLOT(slotUrlCopy()), ac, "copy_url" );
+ TQT_SLOT(slotUrlCopy()), ac, "copy_url" );
mUrlOpenAction = new KAction( i18n("Open URL"), 0, this,
- SLOT(slotUrlOpen()), ac, "open_url" );
+ TQT_SLOT(slotUrlOpen()), ac, "open_url" );
mAddBookmarksAction = new KAction( i18n("Bookmark This Link"),
"bookmark_add",
- 0, this, SLOT(slotAddBookmarks()),
+ 0, this, TQT_SLOT(slotAddBookmarks()),
ac, "add_bookmarks" );
mUrlSaveAsAction = new KAction( i18n("Save Link As..."), 0, this,
- SLOT(slotUrlSave()), ac, "saveas_url" );
+ TQT_SLOT(slotUrlSave()), ac, "saveas_url" );
mToggleFixFontAction = new KToggleAction( i18n("Use Fi&xed Font"),
- Key_X, this, SLOT(slotToggleFixedFont()),
+ Key_X, this, TQT_SLOT(slotToggleFixedFont()),
ac, "toggle_fixedfont" );
mStartIMChatAction = new KAction( i18n("Chat &With..."), 0, this,
- SLOT(slotIMChat()), ac, "start_im_chat" );
+ TQT_SLOT(slotIMChat()), ac, "start_im_chat" );
}
// little helper function
@@ -881,14 +881,14 @@ void KMReaderWin::update( KMail::Interface::Observable * observable )
// update the tmp file
// we have to set it writeable temporarily
- ::chmod( QFile::encodeName( mAtmCurrentName ), S_IRWXU );
- QByteArray data = node->msgPart().bodyDecodedBinary();
+ ::chmod( TQFile::encodeName( mAtmCurrentName ), S_IRWXU );
+ TQByteArray data = node->msgPart().bodyDecodedBinary();
size_t size = data.size();
if ( node->msgPart().type() == DwMime::kTypeText && size) {
size = KMail::Util::crlf2lf( data.data(), size );
}
KPIM::kBytesToFile( data.data(), size, mAtmCurrentName, false, false, false );
- ::chmod( QFile::encodeName( mAtmCurrentName ), S_IRUSR );
+ ::chmod( TQFile::encodeName( mAtmCurrentName ), S_IRUSR );
mAtmUpdate = false;
}
@@ -896,34 +896,34 @@ void KMReaderWin::update( KMail::Interface::Observable * observable )
//-----------------------------------------------------------------------------
void KMReaderWin::removeTempFiles()
{
- for (QStringList::Iterator it = mTempFiles.begin(); it != mTempFiles.end();
+ for (TQStringList::Iterator it = mTempFiles.begin(); it != mTempFiles.end();
it++)
{
- QFile::remove(*it);
+ TQFile::remove(*it);
}
mTempFiles.clear();
- for (QStringList::Iterator it = mTempDirs.begin(); it != mTempDirs.end();
+ for (TQStringList::Iterator it = mTempDirs.begin(); it != mTempDirs.end();
it++)
{
- QDir(*it).rmdir(*it);
+ TQDir(*it).rmdir(*it);
}
mTempDirs.clear();
}
//-----------------------------------------------------------------------------
-bool KMReaderWin::event(QEvent *e)
+bool KMReaderWin::event(TQEvent *e)
{
- if (e->type() == QEvent::ApplicationPaletteChange)
+ if (e->type() == TQEvent::ApplicationPaletteChange)
{
delete mCSSHelper;
- mCSSHelper = new KMail::CSSHelper( QPaintDeviceMetrics( mViewer->view() ) );
+ mCSSHelper = new KMail::CSSHelper( TQPaintDeviceMetrics( mViewer->view() ) );
if (message())
message()->readConfig();
update( true ); // Force update
return true;
}
- return QWidget::event(e);
+ return TQWidget::event(e);
}
@@ -934,7 +934,7 @@ void KMReaderWin::readConfig(void)
/*should be: const*/ KConfigGroup reader( KMKernel::config(), "Reader" );
delete mCSSHelper;
- mCSSHelper = new KMail::CSSHelper( QPaintDeviceMetrics( mViewer->view() ) );
+ mCSSHelper = new KMail::CSSHelper( TQPaintDeviceMetrics( mViewer->view() ) );
mNoMDNsWhenEncrypted = mdnGroup.readBoolEntry( "not-send-when-encrypted", true );
@@ -965,7 +965,7 @@ void KMReaderWin::readConfig(void)
reader.writeEntry( "showColorbar", mShowColorbar );
mMimeTreeAtBottom = reader.readEntry( "MimeTreeLocation", "bottom" ) != "top";
- const QString s = reader.readEntry( "MimeTreeMode", "smart" );
+ const TQString s = reader.readEntry( "MimeTreeMode", "smart" );
if ( s == "never" )
mMimeTreeMode = 0;
else if ( s == "always" )
@@ -1014,7 +1014,7 @@ void KMReaderWin::saveSplitterSizes( KConfigBase & c ) const {
if ( !mSplitter || !mMimePartTree )
return;
if ( mMimePartTree->isHidden() )
- return; // don't rely on QSplitter maintaining sizes for hidden widgets.
+ return; // don't rely on TQSplitter maintaining sizes for hidden widgets.
c.writeEntry( "MimePaneHeight", mSplitter->sizes()[ mMimeTreeAtBottom ? 1 : 0 ] );
c.writeEntry( "MessagePaneHeight", mSplitter->sizes()[ mMimeTreeAtBottom ? 0 : 1 ] );
@@ -1055,41 +1055,41 @@ void KMReaderWin::initHtmlWidget(void)
if ( !htmlWriter() )
#ifdef KMAIL_READER_HTML_DEBUG
- mHtmlWriter = new TeeHtmlWriter( new FileHtmlWriter( QString::null ),
+ mHtmlWriter = new TeeHtmlWriter( new FileHtmlWriter( TQString::null ),
new KHtmlPartHtmlWriter( mViewer, 0 ) );
#else
mHtmlWriter = new KHtmlPartHtmlWriter( mViewer, 0 );
#endif
connect(mViewer->browserExtension(),
- SIGNAL(openURLRequest(const KURL &, const KParts::URLArgs &)),this,
- SLOT(slotUrlOpen(const KURL &)));
+ TQT_SIGNAL(openURLRequest(const KURL &, const KParts::URLArgs &)),this,
+ TQT_SLOT(slotUrlOpen(const KURL &)));
connect(mViewer->browserExtension(),
- SIGNAL(createNewWindow(const KURL &, const KParts::URLArgs &)),this,
- SLOT(slotUrlOpen(const KURL &)));
- connect(mViewer,SIGNAL(onURL(const QString &)),this,
- SLOT(slotUrlOn(const QString &)));
- connect(mViewer,SIGNAL(popupMenu(const QString &, const QPoint &)),
- SLOT(slotUrlPopup(const QString &, const QPoint &)));
- connect( kmkernel->imProxy(), SIGNAL( sigContactPresenceChanged( const QString & ) ),
- this, SLOT( contactStatusChanged( const QString & ) ) );
- connect( kmkernel->imProxy(), SIGNAL( sigPresenceInfoExpired() ),
- this, SLOT( updateReaderWin() ) );
+ TQT_SIGNAL(createNewWindow(const KURL &, const KParts::URLArgs &)),this,
+ TQT_SLOT(slotUrlOpen(const KURL &)));
+ connect(mViewer,TQT_SIGNAL(onURL(const TQString &)),this,
+ TQT_SLOT(slotUrlOn(const TQString &)));
+ connect(mViewer,TQT_SIGNAL(popupMenu(const TQString &, const TQPoint &)),
+ TQT_SLOT(slotUrlPopup(const TQString &, const TQPoint &)));
+ connect( kmkernel->imProxy(), TQT_SIGNAL( sigContactPresenceChanged( const TQString & ) ),
+ this, TQT_SLOT( contactStatusChanged( const TQString & ) ) );
+ connect( kmkernel->imProxy(), TQT_SIGNAL( sigPresenceInfoExpired() ),
+ this, TQT_SLOT( updateReaderWin() ) );
}
-void KMReaderWin::contactStatusChanged( const QString &uid)
+void KMReaderWin::contactStatusChanged( const TQString &uid)
{
// kdDebug( 5006 ) << k_funcinfo << " got a presence change for " << uid << endl;
// get the list of nodes for this contact from the htmlView
DOM::NodeList presenceNodes = mViewer->htmlDocument()
- .getElementsByName( DOM::DOMString( QString::fromLatin1("presence-") + uid ) );
+ .getElementsByName( DOM::DOMString( TQString::fromLatin1("presence-") + uid ) );
for ( unsigned int i = 0; i < presenceNodes.length(); ++i ) {
DOM::Node n = presenceNodes.item( i );
kdDebug( 5006 ) << "name is " << n.nodeName().string() << endl;
kdDebug( 5006 ) << "value of content was " << n.firstChild().nodeValue().string() << endl;
- QString newPresence = kmkernel->imProxy()->presenceString( uid );
- if ( newPresence.isNull() ) // KHTML crashes if you setNodeValue( QString::null )
- newPresence = QString::fromLatin1( "ENOIMRUNNING" );
+ TQString newPresence = kmkernel->imProxy()->presenceString( uid );
+ if ( newPresence.isNull() ) // KHTML crashes if you setNodeValue( TQString::null )
+ newPresence = TQString::fromLatin1( "ENOIMRUNNING" );
n.firstChild().setNodeValue( newPresence );
// kdDebug( 5006 ) << "value of content is now " << n.firstChild().nodeValue().string() << endl;
}
@@ -1109,7 +1109,7 @@ void KMReaderWin::setHeaderStyleAndStrategy( const HeaderStyle * style,
}
//-----------------------------------------------------------------------------
-void KMReaderWin::setOverrideEncoding( const QString & encoding )
+void KMReaderWin::setOverrideEncoding( const TQString & encoding )
{
if ( encoding == mOverrideEncoding )
return;
@@ -1120,9 +1120,9 @@ void KMReaderWin::setOverrideEncoding( const QString & encoding )
mSelectEncodingAction->setCurrentItem( 0 );
}
else {
- QStringList encodings = mSelectEncodingAction->items();
+ TQStringList encodings = mSelectEncodingAction->items();
uint i = 0;
- for ( QStringList::const_iterator it = encodings.begin(), end = encodings.end(); it != end; ++it, ++i ) {
+ for ( TQStringList::const_iterator it = encodings.begin(), end = encodings.end(); it != end; ++it, ++i ) {
if ( KGlobal::charsets()->encodingForName( *it ) == encoding ) {
mSelectEncodingAction->setCurrentItem( i );
break;
@@ -1133,7 +1133,7 @@ void KMReaderWin::setOverrideEncoding( const QString & encoding )
kdWarning(5006) << "Unknown override character encoding \"" << encoding
<< "\". Using Auto instead." << endl;
mSelectEncodingAction->setCurrentItem( 0 );
- mOverrideEncoding = QString::null;
+ mOverrideEncoding = TQString::null;
}
}
}
@@ -1141,14 +1141,14 @@ void KMReaderWin::setOverrideEncoding( const QString & encoding )
}
-void KMReaderWin::setPrintFont( const QFont& font )
+void KMReaderWin::setPrintFont( const TQFont& font )
{
mCSSHelper->setPrintFont( font );
}
//-----------------------------------------------------------------------------
-const QTextCodec * KMReaderWin::overrideCodec() const
+const TQTextCodec * KMReaderWin::overrideCodec() const
{
kdDebug(5006) << k_funcinfo << " mOverrideEncoding == '" << mOverrideEncoding << "'" << endl;
if ( mOverrideEncoding.isEmpty() || mOverrideEncoding == "Auto" ) // Auto
@@ -1161,7 +1161,7 @@ const QTextCodec * KMReaderWin::overrideCodec() const
void KMReaderWin::slotSetEncoding()
{
if ( mSelectEncodingAction->currentItem() == 0 ) // Auto
- mOverrideEncoding = QString();
+ mOverrideEncoding = TQString();
else
mOverrideEncoding = KGlobal::charsets()->encodingForName( mSelectEncodingAction->currentText() );
update( true );
@@ -1305,9 +1305,9 @@ static const int numKMailNewFeatures =
//-----------------------------------------------------------------------------
//static
-QString KMReaderWin::newFeaturesMD5()
+TQString KMReaderWin::newFeaturesMD5()
{
- QCString str;
+ TQCString str;
for ( int i = 0 ; i < numKMailChanges ; ++i )
str += kmailChanges[i];
for ( int i = 0 ; i < numKMailNewFeatures ; ++i )
@@ -1317,13 +1317,13 @@ QString KMReaderWin::newFeaturesMD5()
}
//-----------------------------------------------------------------------------
-void KMReaderWin::displaySplashPage( const QString &info )
+void KMReaderWin::displaySplashPage( const TQString &info )
{
mMsgDisplay = false;
adjustLayout();
- QString location = locate("data", "kmail/about/main.html");
- QString content = KPIM::kFileToString(location);
+ TQString location = locate("data", "kmail/about/main.html");
+ TQString content = KPIM::kFileToString(location);
content = content.arg( locate( "data", "libkdepim/about/kde_infopage.css" ) );
if ( kapp->reverseLayout() )
content = content.arg( "@import \"%1\";" ).arg( locate( "data", "libkdepim/about/kde_infopage_rtl.css" ) );
@@ -1332,17 +1332,17 @@ void KMReaderWin::displaySplashPage( const QString &info )
mViewer->begin(KURL( location ));
- QString fontSize = QString::number( pointsToPixel( mCSSHelper->bodyFont().pointSize() ) );
- QString appTitle = i18n("KMail");
- QString catchPhrase = ""; //not enough space for a catch phrase at default window size i18n("Part of the Kontact Suite");
- QString quickDescription = i18n("The email client for the K Desktop Environment.");
+ TQString fontSize = TQString::number( pointsToPixel( mCSSHelper->bodyFont().pointSize() ) );
+ TQString appTitle = i18n("KMail");
+ TQString catchPhrase = ""; //not enough space for a catch phrase at default window size i18n("Part of the Kontact Suite");
+ TQString quickDescription = i18n("The email client for the K Desktop Environment.");
mViewer->write(content.arg(fontSize).arg(appTitle).arg(catchPhrase).arg(quickDescription).arg(info));
mViewer->end();
}
void KMReaderWin::displayBusyPage()
{
- QString info =
+ TQString info =
i18n( "Retrieving Folder Contents
Please wait . . .
" );
displaySplashPage( info );
@@ -1350,7 +1350,7 @@ void KMReaderWin::displayBusyPage()
void KMReaderWin::displayOfflinePage()
{
- QString info =
+ TQString info =
i18n( "Offline
KMail is currently in offline mode. "
"Click here to go online . . .
" );
@@ -1361,7 +1361,7 @@ void KMReaderWin::displayOfflinePage()
//-----------------------------------------------------------------------------
void KMReaderWin::displayAboutPage()
{
- QString info =
+ TQString info =
i18n("%1: KMail version; %2: help:// URL; %3: homepage URL; "
"%4: prior KMail version; %5: prior KDE version; "
"%6: generated list of new features; "
@@ -1389,7 +1389,7 @@ void KMReaderWin::displayAboutPage()
.arg("http://kontact.kde.org/kmail/") // KMail homepage URL
.arg("1.8").arg("3.4"); // prior KMail and KDE version
- QString featureItems;
+ TQString featureItems;
for ( int i = 0 ; i < numKMailNewFeatures ; i++ )
featureItems += i18n("%1\n").arg( i18n( kmailNewFeatures[i] ) );
@@ -1403,11 +1403,11 @@ void KMReaderWin::displayAboutPage()
"an incoming as well as outgoing mail account."
"
\n") );
} else {
- info = info.arg( QString::null );
+ info = info.arg( TQString::null );
}
if ( ( numKMailChanges > 1 ) || ( numKMailChanges == 1 && strlen(kmailChanges[0]) > 0 ) ) {
- QString changesText =
+ TQString changesText =
i18n(""
"Important changes (compared to KMail %1):
\n")
.arg("1.8");
@@ -1460,7 +1460,7 @@ void KMReaderWin::updateReaderWin()
if (mSavedRelativePosition)
{
- QScrollView * scrollview = static_cast(mViewer->widget());
+ TQScrollView * scrollview = static_cast(mViewer->widget());
scrollview->setContentsPos( 0,
qRound( scrollview->contentsHeight() * mSavedRelativePosition ) );
mSavedRelativePosition = 0;
@@ -1470,7 +1470,7 @@ void KMReaderWin::updateReaderWin()
//-----------------------------------------------------------------------------
int KMReaderWin::pointsToPixel(int pointSize) const
{
- const QPaintDeviceMetrics pdm(mViewer->view());
+ const TQPaintDeviceMetrics pdm(mViewer->view());
return (pointSize * pdm.logicalDpiY() + 36) / 72;
}
@@ -1481,7 +1481,7 @@ void KMReaderWin::showHideMimeTree( bool isPlainTextTopLevel ) {
( mMimeTreeMode == 1 && !isPlainTextTopLevel ) )
mMimePartTree->show();
else {
- // don't rely on QSplitter maintaining sizes for hidden widgets:
+ // don't rely on TQSplitter maintaining sizes for hidden widgets:
KConfigGroup reader( KMKernel::config(), "Reader" );
saveSplitterSizes( reader );
mMimePartTree->hide();
@@ -1519,7 +1519,7 @@ void KMReaderWin::displayMessage() {
htmlWriter()->queue("