diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kmail/kmreaderwin.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/kmreaderwin.cpp')
-rw-r--r-- | kmail/kmreaderwin.cpp | 472 |
1 files changed, 236 insertions, 236 deletions
diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp index c3030304c..b5ee41052 100644 --- a/kmail/kmreaderwin.cpp +++ b/kmail/kmreaderwin.cpp @@ -110,14 +110,14 @@ using KMail::TeeHtmlWriter; #include <kasciistricmp.h> #include <kurldrag.h> -#include <qclipboard.h> -#include <qhbox.h> -#include <qtextcodec.h> -#include <qpaintdevicemetrics.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qsplitter.h> -#include <qstyle.h> +#include <tqclipboard.h> +#include <tqhbox.h> +#include <tqtextcodec.h> +#include <tqpaintdevicemetrics.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqsplitter.h> +#include <tqstyle.h> // 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( "<h2 style='margin-top: 0px;'>Retrieving Folder Contents</h2><p>Please wait . . .</p> " ); displaySplashPage( info ); @@ -1350,7 +1350,7 @@ void KMReaderWin::displayBusyPage() void KMReaderWin::displayOfflinePage() { - QString info = + TQString info = i18n( "<h2 style='margin-top: 0px;'>Offline</h2><p>KMail is currently in offline mode. " "Click <a href=\"kmail:goOnline\">here</a> to go online . . .</p> " ); @@ -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("<li>%1</li>\n").arg( i18n( kmailNewFeatures[i] ) ); @@ -1403,11 +1403,11 @@ void KMReaderWin::displayAboutPage() "an incoming as well as outgoing mail account." "</p>\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("<p><span style='font-size:125%; font-weight:bold;'>" "Important changes</span> (compared to KMail %1):</p>\n") .arg("1.8"); @@ -1460,7 +1460,7 @@ void KMReaderWin::updateReaderWin() if (mSavedRelativePosition) { - QScrollView * scrollview = static_cast<QScrollView *>(mViewer->widget()); + TQScrollView * scrollview = static_cast<TQScrollView *>(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("</body></html>"); htmlWriter()->flush(); - QTimer::singleShot( 1, this, SLOT(injectAttachments()) ); + TQTimer::singleShot( 1, this, TQT_SLOT(injectAttachments()) ); } @@ -1534,8 +1534,8 @@ void KMReaderWin::parseMsg(KMMessage* aMsg) #endif KMMessagePart msgPart; - QCString subtype, contDisp; - QByteArray str; + TQCString subtype, contDisp; + TQByteArray str; assert(aMsg!=0); @@ -1548,13 +1548,13 @@ void KMReaderWin::parseMsg(KMMessage* aMsg) } else delete mRootNode; mRootNode = partNode::fromMessage( aMsg ); - const QCString mainCntTypeStr = mRootNode->typeString() + '/' + mRootNode->subTypeString(); + const TQCString mainCntTypeStr = mRootNode->typeString() + '/' + mRootNode->subTypeString(); - QString cntDesc = aMsg->subject(); + TQString cntDesc = aMsg->subject(); if( cntDesc.isEmpty() ) cntDesc = i18n("( body part )"); KIO::filesize_t cntSize = aMsg->msgSize(); - QString cntEnc; + TQString cntEnc; if( aMsg->contentTransferEncodingStr().isEmpty() ) cntEnc = "7bit"; else @@ -1573,7 +1573,7 @@ void KMReaderWin::parseMsg(KMMessage* aMsg) if( vCardNode ) { // ### FIXME: We should only do this if the vCard belongs to the sender, // ### i.e. if the sender's email address is contained in the vCard. - const QString vcard = vCardNode->msgPart().bodyToUnicode( overrideCodec() ); + const TQString vcard = vCardNode->msgPart().bodyToUnicode( overrideCodec() ); KABC::VCardConverter t; if ( !t.parseVCards( vcard ).empty() ) { hasVCard = true; @@ -1645,7 +1645,7 @@ kdDebug(5006) << "KMReaderWin - calling objectTreeToDecryptedMsg()" << endl; objectTreeToDecryptedMsg( mRootNode, decryptedData, *aMsg ); // add a \0 to the data decryptedData.appendNULL(); - QCString resultString( decryptedData.data() ); + TQCString resultString( decryptedData.data() ); kdDebug(5006) << "KMReaderWin - resulting data:" << resultString << endl; if( !resultString.isEmpty() ) { @@ -1690,15 +1690,15 @@ kdDebug(5006) << "KMReaderWin - composing unencrypted message" << endl; //----------------------------------------------------------------------------- -QString KMReaderWin::writeMsgHeader(KMMessage* aMsg, bool hasVCard, bool topLevel) +TQString KMReaderWin::writeMsgHeader(KMMessage* aMsg, bool hasVCard, bool topLevel) { kdFatal( !headerStyle(), 5006 ) << "trying to writeMsgHeader() without a header style set!" << endl; kdFatal( !headerStrategy(), 5006 ) << "trying to writeMsgHeader() without a header strategy set!" << endl; - QString href; + TQString href; if (hasVCard) - href = QString("file:") + KURL::encode_string( mTempFiles.last() ); + href = TQString("file:") + KURL::encode_string( mTempFiles.last() ); return headerStyle()->format( aMsg, headerStrategy(), href, mPrinting, topLevel ); } @@ -1706,17 +1706,17 @@ QString KMReaderWin::writeMsgHeader(KMMessage* aMsg, bool hasVCard, bool topLeve //----------------------------------------------------------------------------- -QString KMReaderWin::writeMessagePartToTempFile( KMMessagePart* aMsgPart, +TQString KMReaderWin::writeMessagePartToTempFile( KMMessagePart* aMsgPart, int aPartNum ) { - QString fileName = aMsgPart->fileName(); + TQString fileName = aMsgPart->fileName(); if( fileName.isEmpty() ) fileName = aMsgPart->name(); //--- Sven's save attachments to /tmp start --- - QString fname = createTempDir( QString::number( aPartNum ) ); + TQString fname = createTempDir( TQString::number( aPartNum ) ); if ( fname.isEmpty() ) - return QString(); + return TQString(); // strip off a leading path int slashPos = fileName.findRev( '/' ); @@ -1726,35 +1726,35 @@ QString KMReaderWin::writeMessagePartToTempFile( KMMessagePart* aMsgPart, fileName = "unnamed"; fname += "/" + fileName; - QByteArray data = aMsgPart->bodyDecodedBinary(); + TQByteArray data = aMsgPart->bodyDecodedBinary(); size_t size = data.size(); if ( aMsgPart->type() == DwMime::kTypeText && size) { // convert CRLF to LF before writing text attachments to disk size = KMail::Util::crlf2lf( data.data(), size ); } if( !KPIM::kBytesToFile( data.data(), size, fname, false, false, false ) ) - return QString::null; + return TQString::null; mTempFiles.append( fname ); // make file read-only so that nobody gets the impression that he might // edit attached files (cf. bug #52813) - ::chmod( QFile::encodeName( fname ), S_IRUSR ); + ::chmod( TQFile::encodeName( fname ), S_IRUSR ); return fname; } -QString KMReaderWin::createTempDir( const QString ¶m ) +TQString KMReaderWin::createTempDir( const TQString ¶m ) { - KTempFile *tempFile = new KTempFile( QString::null, "." + param ); + KTempFile *tempFile = new KTempFile( TQString::null, "." + param ); tempFile->setAutoDelete( true ); - QString fname = tempFile->name(); + TQString fname = tempFile->name(); delete tempFile; - if( ::access( QFile::encodeName( fname ), W_OK ) != 0 ) + if( ::access( TQFile::encodeName( fname ), W_OK ) != 0 ) // Not there or not writable - if( ::mkdir( QFile::encodeName( fname ), 0 ) != 0 - || ::chmod( QFile::encodeName( fname ), S_IRWXU ) != 0 ) - return QString::null; //failed create + if( ::mkdir( TQFile::encodeName( fname ), 0 ) != 0 + || ::chmod( TQFile::encodeName( fname ), S_IRWXU ) != 0 ) + return TQString::null; //failed create assert( !fname.isNull() ); @@ -1764,7 +1764,7 @@ QString KMReaderWin::createTempDir( const QString ¶m ) //----------------------------------------------------------------------------- void KMReaderWin::showVCard( KMMessagePart * msgPart ) { - const QString vCard = msgPart->bodyToUnicode( overrideCodec() ); + const TQString vCard = msgPart->bodyToUnicode( overrideCodec() ); VCardViewer *vcv = new VCardViewer(this, vCard, "vCardDialog"); vcv->show(); @@ -1791,7 +1791,7 @@ int KMReaderWin::msgPartFromUrl(const KURL &aUrl) if (!aUrl.isLocalFile()) return -1; - QString path = aUrl.path(); + TQString path = aUrl.path(); uint right = path.findRev('/'); uint left = path.findRev('.', right); @@ -1801,7 +1801,7 @@ int KMReaderWin::msgPartFromUrl(const KURL &aUrl) //----------------------------------------------------------------------------- -void KMReaderWin::resizeEvent(QResizeEvent *) +void KMReaderWin::resizeEvent(TQResizeEvent *) { if( !mResizeTimer.isActive() ) { @@ -1856,19 +1856,19 @@ void KMReaderWin::slotTouchMessage() //----------------------------------------------------------------------------- -void KMReaderWin::closeEvent(QCloseEvent *e) +void KMReaderWin::closeEvent(TQCloseEvent *e) { - QWidget::closeEvent(e); + TQWidget::closeEvent(e); writeConfig(); } -bool foundSMIMEData( const QString aUrl, - QString& displayName, - QString& libName, - QString& keyId ) +bool foundSMIMEData( const TQString aUrl, + TQString& displayName, + TQString& libName, + TQString& keyId ) { - static QString showCertMan("showCertificate#"); + static TQString showCertMan("showCertificate#"); displayName = ""; libName = ""; keyId = ""; @@ -1907,7 +1907,7 @@ bool foundSMIMEData( const QString aUrl, //----------------------------------------------------------------------------- -void KMReaderWin::slotUrlOn(const QString &aUrl) +void KMReaderWin::slotUrlOn(const TQString &aUrl) { const KURL url(aUrl); if ( url.protocol() == "kmail" || url.protocol() == "x-kmail" @@ -1924,7 +1924,7 @@ void KMReaderWin::slotUrlOn(const QString &aUrl) mUrlClicked = url; - const QString msg = URLHandlerManager::instance()->statusBarMessage( url, this ); + const TQString msg = URLHandlerManager::instance()->statusBarMessage( url, this ); kdWarning( msg.isEmpty(), 5006 ) << "KMReaderWin::slotUrlOn(): Unhandled URL hover!" << endl; KPIM::BroadcastStatus::instance()->setTransientStatusMsg( msg ); @@ -1944,7 +1944,7 @@ void KMReaderWin::slotUrlOpen(const KURL &aUrl, const KParts::URLArgs &) } //----------------------------------------------------------------------------- -void KMReaderWin::slotUrlPopup(const QString &aUrl, const QPoint& aPos) +void KMReaderWin::slotUrlPopup(const TQString &aUrl, const TQPoint& aPos) { const KURL url( aUrl ); mUrlClicked = url; @@ -1959,7 +1959,7 @@ void KMReaderWin::slotUrlPopup(const QString &aUrl, const QPoint& aPos) } //----------------------------------------------------------------------------- -void KMReaderWin::showAttachmentPopup( int id, const QString & name, const QPoint & p ) +void KMReaderWin::showAttachmentPopup( int id, const TQString & name, const TQPoint & p ) { mAtmCurrent = id; mAtmCurrentName = name; @@ -1977,7 +1977,7 @@ void KMReaderWin::showAttachmentPopup( int id, const QString & name, const QPoin Kleo::CryptoBackendFactory::instance()->protocol( "Chiasmus" ) ) menu->insertItem( i18n( "Decrypt With Chiasmus..." ), 6 ); menu->insertItem(i18n("Properties"), 5); - connect(menu, SIGNAL(activated(int)), this, SLOT(slotHandleAttachment(int))); + connect(menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotHandleAttachment(int))); menu->exec( p ,0 ); delete menu; } @@ -1990,9 +1990,9 @@ void KMReaderWin::setStyleDependantFrameWidth() // set the width of the frame to a reasonable value for the current GUI style int frameWidth; if( style().isA("KeramikStyle") ) - frameWidth = style().pixelMetric( QStyle::PM_DefaultFrameWidth ) - 1; + frameWidth = style().pixelMetric( TQStyle::PM_DefaultFrameWidth ) - 1; else - frameWidth = style().pixelMetric( QStyle::PM_DefaultFrameWidth ); + frameWidth = style().pixelMetric( TQStyle::PM_DefaultFrameWidth ); if ( frameWidth < 0 ) frameWidth = 0; if ( frameWidth != mBox->lineWidth() ) @@ -2000,10 +2000,10 @@ void KMReaderWin::setStyleDependantFrameWidth() } //----------------------------------------------------------------------------- -void KMReaderWin::styleChange( QStyle& oldStyle ) +void KMReaderWin::styleChange( TQStyle& oldStyle ) { setStyleDependantFrameWidth(); - QWidget::styleChange( oldStyle ); + TQWidget::styleChange( oldStyle ); } //----------------------------------------------------------------------------- @@ -2017,8 +2017,8 @@ void KMReaderWin::slotHandleAttachment( int choice ) KMHandleAttachmentCommand* command = new KMHandleAttachmentCommand( node, message(), mAtmCurrent, mAtmCurrentName, KMHandleAttachmentCommand::AttachmentAction( choice ), 0, this ); - connect( command, SIGNAL( showAttachment( int, const QString& ) ), - this, SLOT( slotAtmView( int, const QString& ) ) ); + connect( command, TQT_SIGNAL( showAttachment( int, const TQString& ) ), + this, TQT_SLOT( slotAtmView( int, const TQString& ) ) ); command->start(); } else if ( choice == 7 ) { slotDeleteAttachment( node ); @@ -2031,7 +2031,7 @@ void KMReaderWin::slotHandleAttachment( int choice ) if (!url.isValid() ) return; urls.append( url ); KURLDrag* drag = new KURLDrag( urls, this ); - QApplication::clipboard()->setData( drag, QClipboard::Clipboard ); + TQApplication::clipboard()->setData( drag, QClipboard::Clipboard ); } } @@ -2098,7 +2098,7 @@ void KMReaderWin::setMsgPart( partNode * node ) { //----------------------------------------------------------------------------- void KMReaderWin::setMsgPart( KMMessagePart* aMsgPart, bool aHTML, - const QString& aFileName, const QString& pname ) + const TQString& aFileName, const TQString& pname ) { KCursorSaver busy(KBusyPtr::busy()); if (kasciistricmp(aMsgPart->typeStr(), "message")==0) { @@ -2122,11 +2122,11 @@ void KMReaderWin::setMsgPart( KMMessagePart* aMsgPart, bool aHTML, htmlWriter()->queue( aMsgPart->bodyToUnicode( overrideCodec() ) ); mColorBar->setHtmlMode(); } else { // plain text - const QCString str = aMsgPart->bodyDecoded(); + const TQCString str = aMsgPart->bodyDecoded(); ObjectTreeParser otp( this ); otp.writeBodyStr( str, overrideCodec() ? overrideCodec() : aMsgPart->codec(), - message() ? message()->from() : QString::null ); + message() ? message()->from() : TQString::null ); } htmlWriter()->queue("</body></html>"); htmlWriter()->flush(); @@ -2137,11 +2137,11 @@ void KMReaderWin::setMsgPart( KMMessagePart* aMsgPart, bool aHTML, { if (aFileName.isEmpty()) return; // prevent crash // Open the window with a size so the image fits in (if possible): - QImageIO *iio = new QImageIO(); + TQImageIO *iio = new TQImageIO(); iio->setFileName(aFileName); if( iio->read() ) { - QImage img = iio->image(); - QRect desk = KGlobalSettings::desktopGeometry(mMainWindow); + TQImage img = iio->image(); + TQRect desk = KGlobalSettings::desktopGeometry(mMainWindow); // determine a reasonable window size int width, height; if( img.width() < 50 ) @@ -2173,15 +2173,15 @@ void KMReaderWin::setMsgPart( KMMessagePart* aMsgPart, bool aHTML, htmlWriter()->queue( mCSSHelper->htmlHead( isFixedFont() ) ); htmlWriter()->queue( "<pre>" ); - QString str = aMsgPart->bodyDecoded(); - // A QString cannot handle binary data. So if it's shorter than the + TQString str = aMsgPart->bodyDecoded(); + // A TQString cannot handle binary data. So if it's shorter than the // attachment, we assume the attachment is binary: if( str.length() < (unsigned) aMsgPart->decodedSize() ) { str.prepend( i18n("[KMail: Attachment contains binary data. Trying to show first character.]", "[KMail: Attachment contains binary data. Trying to show first %n characters.]", - str.length()) + QChar('\n') ); + str.length()) + TQChar('\n') ); } - htmlWriter()->queue( QStyleSheet::escape( str ) ); + htmlWriter()->queue( TQStyleSheet::escape( str ) ); htmlWriter()->queue( "</pre>" ); htmlWriter()->queue("</body></html>"); htmlWriter()->flush(); @@ -2192,7 +2192,7 @@ void KMReaderWin::setMsgPart( KMMessagePart* aMsgPart, bool aHTML, //----------------------------------------------------------------------------- -void KMReaderWin::slotAtmView( int id, const QString& name ) +void KMReaderWin::slotAtmView( int id, const TQString& name ) { partNode* node = mRootNode ? mRootNode->findId( id ) : 0; if( node ) { @@ -2202,7 +2202,7 @@ void KMReaderWin::slotAtmView( int id, const QString& name ) mAtmCurrentName = tempFileUrlFromPartNode( node ).path(); KMMessagePart& msgPart = node->msgPart(); - QString pname = msgPart.fileName(); + TQString pname = msgPart.fileName(); if (pname.isEmpty()) pname=msgPart.name(); if (pname.isEmpty()) pname=msgPart.contentDescription(); if (pname.isEmpty()) pname="unnamed"; @@ -2221,12 +2221,12 @@ void KMReaderWin::slotAtmView( int id, const QString& name ) } //----------------------------------------------------------------------------- -void KMReaderWin::openAttachment( int id, const QString & name ) +void KMReaderWin::openAttachment( int id, const TQString & name ) { mAtmCurrentName = name; mAtmCurrent = id; - QString str, pname, cmd, fileName; + TQString str, pname, cmd, fileName; partNode* node = mRootNode ? mRootNode->findId( id ) : 0; if( !node ) { @@ -2243,7 +2243,7 @@ void KMReaderWin::openAttachment( int id, const QString & name ) return; } - QCString contentTypeStr( msgPart.typeStr() + '/' + msgPart.subtypeStr() ); + TQCString contentTypeStr( msgPart.typeStr() + '/' + msgPart.subtypeStr() ); KPIM::kAsciiToLower( contentTypeStr.data() ); if ( qstrcmp( contentTypeStr, "text/x-vcard" ) == 0 ) { @@ -2254,7 +2254,7 @@ void KMReaderWin::openAttachment( int id, const QString & name ) // determine the MIME type of the attachment KMimeType::Ptr mimetype; // prefer the value of the Content-Type header - mimetype = KMimeType::mimeType( QString::fromLatin1( contentTypeStr ) ); + mimetype = KMimeType::mimeType( TQString::fromLatin1( contentTypeStr ) ); if ( mimetype->name() == "application/octet-stream" ) { // consider the filename if Content-Type is application/octet-stream mimetype = KMimeType::findByPath( name, 0, true /* no disk access */ ); @@ -2269,8 +2269,8 @@ void KMReaderWin::openAttachment( int id, const QString & name ) KService::Ptr offer = KServiceTypeProfile::preferredService( mimetype->name(), "Application" ); - QString open_text; - QString filenameText = msgPart.fileName(); + TQString open_text; + TQString filenameText = msgPart.fileName(); if ( filenameText.isEmpty() ) filenameText = msgPart.name(); if ( offer ) { @@ -2278,21 +2278,21 @@ void KMReaderWin::openAttachment( int id, const QString & name ) } else { open_text = i18n("&Open With..."); } - const QString text = i18n("Open attachment '%1'?\n" + const TQString text = i18n("Open attachment '%1'?\n" "Note that opening an attachment may compromise " "your system's security.") .arg( filenameText ); const int choice = KMessageBox::questionYesNoCancel( this, text, i18n("Open Attachment?"), KStdGuiItem::saveAs(), open_text, - QString::fromLatin1("askSave") + mimetype->name() ); // dontAskAgainName + TQString::fromLatin1("askSave") + mimetype->name() ); // dontAskAgainName if( choice == KMessageBox::Yes ) { // Save mAtmUpdate = true; KMHandleAttachmentCommand* command = new KMHandleAttachmentCommand( node, message(), mAtmCurrent, mAtmCurrentName, KMHandleAttachmentCommand::Save, offer, this ); - connect( command, SIGNAL( showAttachment( int, const QString& ) ), - this, SLOT( slotAtmView( int, const QString& ) ) ); + connect( command, TQT_SIGNAL( showAttachment( int, const TQString& ) ), + this, TQT_SLOT( slotAtmView( int, const TQString& ) ) ); command->start(); } else if( choice == KMessageBox::No ) { // Open @@ -2301,8 +2301,8 @@ void KMReaderWin::openAttachment( int id, const QString & name ) mAtmUpdate = true; KMHandleAttachmentCommand* command = new KMHandleAttachmentCommand( node, message(), mAtmCurrent, mAtmCurrentName, action, offer, this ); - connect( command, SIGNAL( showAttachment( int, const QString& ) ), - this, SLOT( slotAtmView( int, const QString& ) ) ); + connect( command, TQT_SIGNAL( showAttachment( int, const TQString& ) ), + this, TQT_SLOT( slotAtmView( int, const TQString& ) ) ); command->start(); } else { // Cancel kdDebug(5006) << "Canceled opening attachment" << endl; @@ -2312,26 +2312,26 @@ void KMReaderWin::openAttachment( int id, const QString & name ) //----------------------------------------------------------------------------- void KMReaderWin::slotScrollUp() { - static_cast<QScrollView *>(mViewer->widget())->scrollBy(0, -10); + static_cast<TQScrollView *>(mViewer->widget())->scrollBy(0, -10); } //----------------------------------------------------------------------------- void KMReaderWin::slotScrollDown() { - static_cast<QScrollView *>(mViewer->widget())->scrollBy(0, 10); + static_cast<TQScrollView *>(mViewer->widget())->scrollBy(0, 10); } bool KMReaderWin::atBottom() const { - const QScrollView *view = static_cast<const QScrollView *>(mViewer->widget()); + const TQScrollView *view = static_cast<const TQScrollView *>(mViewer->widget()); return view->contentsY() + view->visibleHeight() >= view->contentsHeight(); } //----------------------------------------------------------------------------- void KMReaderWin::slotJumpDown() { - QScrollView *view = static_cast<QScrollView *>(mViewer->widget()); + TQScrollView *view = static_cast<TQScrollView *>(mViewer->widget()); int offs = (view->clipper()->height() < 30) ? view->clipper()->height() : 30; view->scrollBy( 0, view->clipper()->height() - offs ); } @@ -2339,14 +2339,14 @@ void KMReaderWin::slotJumpDown() //----------------------------------------------------------------------------- void KMReaderWin::slotScrollPrior() { - static_cast<QScrollView *>(mViewer->widget())->scrollBy(0, -(int)(height()*0.8)); + static_cast<TQScrollView *>(mViewer->widget())->scrollBy(0, -(int)(height()*0.8)); } //----------------------------------------------------------------------------- void KMReaderWin::slotScrollNext() { - static_cast<QScrollView *>(mViewer->widget())->scrollBy(0, (int)(height()*0.8)); + static_cast<TQScrollView *>(mViewer->widget())->scrollBy(0, (int)(height()*0.8)); } //----------------------------------------------------------------------------- @@ -2359,7 +2359,7 @@ void KMReaderWin::slotDocumentChanged() //----------------------------------------------------------------------------- void KMReaderWin::slotTextSelected(bool) { - QString temp = mViewer->selectedText(); + TQString temp = mViewer->selectedText(); kapp->clipboard()->setText(temp); } @@ -2370,9 +2370,9 @@ void KMReaderWin::selectAll() } //----------------------------------------------------------------------------- -QString KMReaderWin::copyText() +TQString KMReaderWin::copyText() { - QString temp = mViewer->selectedText(); + TQString temp = mViewer->selectedText(); return temp; } @@ -2420,7 +2420,7 @@ bool KMReaderWin::htmlLoadExternal() //----------------------------------------------------------------------------- void KMReaderWin::saveRelativePosition() { - const QScrollView * scrollview = static_cast<QScrollView *>( mViewer->widget() ); + const TQScrollView * scrollview = static_cast<TQScrollView *>( mViewer->widget() ); mSavedRelativePosition = static_cast<float>( scrollview->contentsY() ) / scrollview->contentsHeight(); } @@ -2558,11 +2558,11 @@ partNode * KMReaderWin::partNodeForId( int id ) { KURL KMReaderWin::tempFileUrlFromPartNode( const partNode * node ) { if (!node) return KURL(); - QStringList::const_iterator it = mTempFiles.begin(); - QStringList::const_iterator end = mTempFiles.end(); + TQStringList::const_iterator it = mTempFiles.begin(); + TQStringList::const_iterator end = mTempFiles.end(); while ( it != end ) { - QString path = *it; + TQString path = *it; it++; uint right = path.findRev('/'); uint left = path.findRev('.', right); @@ -2602,10 +2602,10 @@ void KMReaderWin::slotIMChat() } //----------------------------------------------------------------------------- -bool KMReaderWin::eventFilter( QObject *, QEvent *e ) +bool KMReaderWin::eventFilter( TQObject *, TQEvent *e ) { - if ( e->type() == QEvent::MouseButtonPress ) { - QMouseEvent* me = static_cast<QMouseEvent*>(e); + if ( e->type() == TQEvent::MouseButtonPress ) { + TQMouseEvent* me = static_cast<TQMouseEvent*>(e); if ( me->button() == LeftButton && ( me->state() & ShiftButton ) ) { // special processing for shift+click mAtmCurrent = msgPartFromUrl( mUrlClicked ); @@ -2664,10 +2664,10 @@ void KMReaderWin::injectAttachments() if ( injectionPoint.isNull() ) return; - QString imgpath( locate("data","kmail/pics/") ); - QString visibility; - QString urlHandle; - QString imgSrc; + TQString imgpath( locate("data","kmail/pics/") ); + TQString visibility; + TQString urlHandle; + TQString imgSrc; if( !showAttachmentQuicklist() ) { urlHandle.append( "kmail:showAttachmentQuicklist" ); @@ -2677,15 +2677,15 @@ void KMReaderWin::injectAttachments() imgSrc.append( "attachmentQuicklistOpened.png" ); } - QString html = renderAttachments( mRootNode, QApplication::palette().active().background() ); + TQString html = renderAttachments( mRootNode, TQApplication::palette().active().background() ); if ( html.isEmpty() ) return; if ( headerStyle() == HeaderStyle::fancy() ) - html.prepend( QString::fromLatin1("<div style=\"float:left;\">%1 </div>" ).arg(i18n("Attachments:")) ); + html.prepend( TQString::fromLatin1("<div style=\"float:left;\">%1 </div>" ).arg(i18n("Attachments:")) ); if ( headerStyle() == HeaderStyle::enterprise() ) { - QString link(""); + TQString link(""); link += "<div style=\"text-align: right;\"><a href=\""+urlHandle+"\"><img src=\""+imgpath+imgSrc+"\"/></a></div>"; html.prepend( link ); } @@ -2694,41 +2694,41 @@ void KMReaderWin::injectAttachments() static_cast<DOM::HTMLElement>( injectionPoint ).setInnerHTML( html ); } -static QColor nextColor( const QColor & c ) +static TQColor nextColor( const TQColor & c ) { int h, s, v; c.hsv( &h, &s, &v ); - return QColor( (h + 50) % 360, QMAX(s, 64), v, QColor::Hsv ); + return TQColor( (h + 50) % 360, QMAX(s, 64), v, TQColor::Hsv ); } -QString KMReaderWin::renderAttachments(partNode * node, const QColor &bgColor ) +TQString KMReaderWin::renderAttachments(partNode * node, const TQColor &bgColor ) { if ( !node ) - return QString(); + return TQString(); - QString html; + TQString html; if ( node->firstChild() ) { - QString subHtml = renderAttachments( node->firstChild(), nextColor( bgColor ) ); + TQString subHtml = renderAttachments( node->firstChild(), nextColor( bgColor ) ); if ( !subHtml.isEmpty() ) { - QString visibility; + TQString visibility; if( !showAttachmentQuicklist() ) { visibility.append( "display:none;" ); } - QString margin; + TQString margin; if ( node != mRootNode || headerStyle() != HeaderStyle::enterprise() ) margin = "padding:2px; margin:2px; "; if ( node->msgPart().typeStr() == "message" || node == mRootNode ) - html += QString::fromLatin1("<div style=\"background:%1; %2" + html += TQString::fromLatin1("<div style=\"background:%1; %2" "vertical-align:middle; float:left; %3\">").arg( bgColor.name() ).arg( margin ).arg( visibility ); html += subHtml; if ( node->msgPart().typeStr() == "message" || node == mRootNode ) html += "</div>"; } } else { - QString label, icon; + TQString label, icon; icon = node->msgPart().iconName( KIcon::Small ); label = node->msgPart().contentDescription(); if( label.isEmpty() ) @@ -2745,12 +2745,12 @@ QString KMReaderWin::renderAttachments(partNode * node, const QColor &bgColor ) typeBlacklisted = typeBlacklisted || node == mRootNode; if ( !label.isEmpty() && !icon.isEmpty() && !typeBlacklisted ) { html += "<div style=\"float:left;\">"; - html += QString::fromLatin1( "<span style=\"white-space:nowrap; border-width: 0px; border-left-width: 5px; border-color: %1; 2px; border-left-style: solid;\">" ).arg( bgColor.name() ); - html += QString::fromLatin1( "<a href=\"#att%1\">" ).arg( node->nodeId() ); + html += TQString::fromLatin1( "<span style=\"white-space:nowrap; border-width: 0px; border-left-width: 5px; border-color: %1; 2px; border-left-style: solid;\">" ).arg( bgColor.name() ); + html += TQString::fromLatin1( "<a href=\"#att%1\">" ).arg( node->nodeId() ); html += "<img style=\"vertical-align:middle;\" src=\"" + icon + "\"/> "; if ( headerStyle() == HeaderStyle::enterprise() ) { - QFont bodyFont = mCSSHelper->bodyFont( isFixedFont() ); - QFontMetrics fm( bodyFont ); + TQFont bodyFont = mCSSHelper->bodyFont( isFixedFont() ); + TQFontMetrics fm( bodyFont ); html += KStringHandler::rPixelSqueeze( label, fm, 140 ); } else html += label; |