summaryrefslogtreecommitdiffstats
path: root/knode/articlewidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'knode/articlewidget.cpp')
-rw-r--r--knode/articlewidget.cpp304
1 files changed, 152 insertions, 152 deletions
diff --git a/knode/articlewidget.cpp b/knode/articlewidget.cpp
index 805632c24..1bb7527fe 100644
--- a/knode/articlewidget.cpp
+++ b/knode/articlewidget.cpp
@@ -15,17 +15,17 @@
#include <stdlib.h>
#include <sys/stat.h>
-#include <qbuffer.h>
-#include <qclipboard.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qimage.h>
-#include <qlayout.h>
-#include <qpaintdevicemetrics.h>
-#include <qpopupmenu.h>
-#include <qstringlist.h>
-#include <qtextcodec.h>
-#include <qtimer.h>
+#include <tqbuffer.h>
+#include <tqclipboard.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqimage.h>
+#include <tqlayout.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqpopupmenu.h>
+#include <tqstringlist.h>
+#include <tqtextcodec.h>
+#include <tqtimer.h>
#include <kaction.h>
#include <kaddrbook.h>
@@ -73,13 +73,13 @@
using namespace KNode;
-QValueList<ArticleWidget*> ArticleWidget::mInstances;
+TQValueList<ArticleWidget*> ArticleWidget::mInstances;
-ArticleWidget::ArticleWidget( QWidget *parent,
+ArticleWidget::ArticleWidget( TQWidget *parent,
KXMLGUIClient *guiClient,
KActionCollection *actionCollection,
const char *name ) :
- QWidget( parent, name ),
+ TQWidget( parent, name ),
mArticle( 0 ),
mViewer( 0 ),
mCSSHelper( 0 ),
@@ -95,7 +95,7 @@ ArticleWidget::ArticleWidget( QWidget *parent,
{
mInstances.append( this );
- QHBoxLayout *box = new QHBoxLayout( this );
+ TQHBoxLayout *box = new TQHBoxLayout( this );
mViewer = new KHTMLPart( this, "mViewer" );
box->addWidget( mViewer->widget() );
mViewer->widget()->setFocusPolicy( WheelFocus );
@@ -104,14 +104,14 @@ ArticleWidget::ArticleWidget( QWidget *parent,
mViewer->setJavaEnabled( false );
mViewer->setMetaRefreshEnabled( false );
mViewer->setOnlyLocalReferences( true );
- mViewer->view()->setFocusPolicy( QWidget::WheelFocus );
- connect( mViewer->browserExtension(), SIGNAL(openURLRequestDelayed(const KURL&, const KParts::URLArgs&)),
- SLOT(slotURLClicked(const KURL&)) );
- connect( mViewer, SIGNAL(popupMenu(const QString&, const QPoint&)),
- SLOT(slotURLPopup(const QString&, const QPoint&)) );
+ mViewer->view()->setFocusPolicy( TQWidget::WheelFocus );
+ connect( mViewer->browserExtension(), TQT_SIGNAL(openURLRequestDelayed(const KURL&, const KParts::URLArgs&)),
+ TQT_SLOT(slotURLClicked(const KURL&)) );
+ connect( mViewer, TQT_SIGNAL(popupMenu(const TQString&, const TQPoint&)),
+ TQT_SLOT(slotURLPopup(const TQString&, const TQPoint&)) );
- mTimer = new QTimer( this );
- connect( mTimer, SIGNAL(timeout()), SLOT(slotTimeout()) );
+ mTimer = new TQTimer( this );
+ connect( mTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimeout()) );
initActions();
readConfig();
@@ -134,85 +134,85 @@ ArticleWidget::~ArticleWidget()
void ArticleWidget::initActions()
{
- mSaveAction = KStdAction::save( this, SLOT(slotSave()), mActionCollection );
+ mSaveAction = KStdAction::save( this, TQT_SLOT(slotSave()), mActionCollection );
mSaveAction->setText( KStdGuiItem::saveAs().text() );
- mPrintAction = KStdAction::print( this, SLOT(slotPrint()), mActionCollection );
- mCopySelectionAction = KStdAction::copy( this, SLOT(slotCopySelection()), mActionCollection );
- mSelectAllAction = KStdAction::selectAll( this, SLOT(slotSelectAll()), mActionCollection );
- mFindAction = KStdAction::find( this, SLOT(slotFind()), mActionCollection, "find_in_article" );
+ mPrintAction = KStdAction::print( this, TQT_SLOT(slotPrint()), mActionCollection );
+ mCopySelectionAction = KStdAction::copy( this, TQT_SLOT(slotCopySelection()), mActionCollection );
+ mSelectAllAction = KStdAction::selectAll( this, TQT_SLOT(slotSelectAll()), mActionCollection );
+ mFindAction = KStdAction::find( this, TQT_SLOT(slotFind()), mActionCollection, "find_in_article" );
mFindAction->setText( i18n("F&ind in Article...") );
mViewSourceAction = new KAction( i18n("&View Source"), Key_V , this,
- SLOT(slotViewSource()), mActionCollection, "article_viewSource" );
+ TQT_SLOT(slotViewSource()), mActionCollection, "article_viewSource" );
mReplyAction = new KAction( i18n("&Followup to Newsgroup..."), "message_reply",
- Key_R, this, SLOT(slotReply()), mActionCollection, "article_postReply" );
+ Key_R, this, TQT_SLOT(slotReply()), mActionCollection, "article_postReply" );
mRemailAction = new KAction( i18n("Reply by E&mail..."), "mail_reply",
- Key_A, this, SLOT(slotRemail()), mActionCollection, "article_mailReply" );
+ Key_A, this, TQT_SLOT(slotRemail()), mActionCollection, "article_mailReply" );
mForwardAction = new KAction( i18n("Forw&ard by Email..."), "mail_forward",
- Key_F, this, SLOT(slotForward()), mActionCollection, "article_forward" );
+ Key_F, this, TQT_SLOT(slotForward()), mActionCollection, "article_forward" );
mCancelAction = new KAction( i18n("article","&Cancel Article"),
- 0, this, SLOT(slotCancel()), mActionCollection, "article_cancel" );
+ 0, this, TQT_SLOT(slotCancel()), mActionCollection, "article_cancel" );
mSupersedeAction = new KAction(i18n("S&upersede Article"),
- 0, this, SLOT(slotSupersede()), mActionCollection, "article_supersede" );
+ 0, this, TQT_SLOT(slotSupersede()), mActionCollection, "article_supersede" );
mFixedFontToggle = new KToggleAction( i18n("U&se Fixed Font"),
- Key_X ,this, SLOT(slotToggleFixedFont()), mActionCollection, "view_useFixedFont" );
+ Key_X ,this, TQT_SLOT(slotToggleFixedFont()), mActionCollection, "view_useFixedFont" );
mFancyToggle = new KToggleAction( i18n("Fancy Formating"),
- Key_Y, this, SLOT(slotToggleFancyFormating()), mActionCollection, "view_fancyFormating" );
+ Key_Y, this, TQT_SLOT(slotToggleFancyFormating()), mActionCollection, "view_fancyFormating" );
mRot13Toggle = new KToggleAction( i18n("&Unscramble (Rot 13)"), "decrypted", 0 , this,
- SLOT(slotToggleRot13()), mActionCollection, "view_rot13" );
+ TQT_SLOT(slotToggleRot13()), mActionCollection, "view_rot13" );
mRot13Toggle->setChecked( false );
KRadioAction *ra;
mHeaderStyleMenu = new KActionMenu( i18n("&Headers"), mActionCollection, "view_headers" );
- ra = new KRadioAction( i18n("&Fancy Headers"), 0, this, SLOT(slotFancyHeaders()),
+ ra = new KRadioAction( i18n("&Fancy Headers"), 0, this, TQT_SLOT(slotFancyHeaders()),
mActionCollection, "view_headers_fancy" );
ra->setExclusiveGroup( "view_headers" );
mHeaderStyleMenu->insert( ra );
- ra = new KRadioAction( i18n("&Standard Headers"), 0, this, SLOT(slotStandardHeaders()),
+ ra = new KRadioAction( i18n("&Standard Headers"), 0, this, TQT_SLOT(slotStandardHeaders()),
mActionCollection, "view_headers_standard" );
ra->setExclusiveGroup( "view_headers" );
mHeaderStyleMenu->insert( ra );
- ra = new KRadioAction( i18n("&All Headers"), 0, this, SLOT(slotAllHeaders()),
+ ra = new KRadioAction( i18n("&All Headers"), 0, this, TQT_SLOT(slotAllHeaders()),
mActionCollection, "view_headers_all" );
ra->setExclusiveGroup( "view_headers" );
mHeaderStyleMenu->insert( ra );
mAttachmentStyleMenu = new KActionMenu( i18n("&Attachments"), mActionCollection, "view_attachments" );
- ra = new KRadioAction( i18n("&As Icon"), 0, this, SLOT(slotIconAttachments()),
+ ra = new KRadioAction( i18n("&As Icon"), 0, this, TQT_SLOT(slotIconAttachments()),
mActionCollection, "view_attachments_icon" );
ra->setExclusiveGroup( "view_attachments" );
mAttachmentStyleMenu->insert( ra );
- ra = new KRadioAction( i18n("&Inline"), 0, this, SLOT(slotInlineAttachments()),
+ ra = new KRadioAction( i18n("&Inline"), 0, this, TQT_SLOT(slotInlineAttachments()),
mActionCollection, "view_attachments_inline" );
ra->setExclusiveGroup( "view_attachments" );
mAttachmentStyleMenu->insert( ra );
- ra = new KRadioAction( i18n("&Hide"), 0, this, SLOT(slotHideAttachments()),
+ ra = new KRadioAction( i18n("&Hide"), 0, this, TQT_SLOT(slotHideAttachments()),
mActionCollection, "view_attachments_hide" );
ra->setExclusiveGroup( "view_attachments" );
mAttachmentStyleMenu->insert( ra );
mCharsetSelect = new KSelectAction( i18n("Chars&et"), 0, mActionCollection, "set_charset" );
mCharsetSelect->setShortcutConfigurable( false );
- QStringList cs = KGlobal::charsets()->descriptiveEncodingNames();
+ TQStringList cs = KGlobal::charsets()->descriptiveEncodingNames();
cs.prepend( i18n("Automatic") );
mCharsetSelect->setItems( cs );
mCharsetSelect->setCurrentItem( 0 );
- connect( mCharsetSelect, SIGNAL(activated(const QString&)),SLOT(slotSetCharset(const QString&)) );
+ connect( mCharsetSelect, TQT_SIGNAL(activated(const TQString&)),TQT_SLOT(slotSetCharset(const TQString&)) );
mCharsetSelectKeyb = new KAction( i18n("Charset"), Key_C, this,
- SLOT(slotSetCharsetKeyboard()), mActionCollection, "set_charset_keyboard" );
+ TQT_SLOT(slotSetCharsetKeyboard()), mActionCollection, "set_charset_keyboard" );
- new KAction( i18n("&Open URL"), "fileopen", 0, this, SLOT(slotOpenURL()),
+ new KAction( i18n("&Open URL"), "fileopen", 0, this, TQT_SLOT(slotOpenURL()),
mActionCollection, "open_url" );
- new KAction( i18n("&Copy Link Address"), "editcopy", 0, this, SLOT( slotCopyURL()),
+ new KAction( i18n("&Copy Link Address"), "editcopy", 0, this, TQT_SLOT( slotCopyURL()),
mActionCollection, "copy_url" );
- new KAction( i18n("&Bookmark This Link"), "bookmark_add", 0, this, SLOT(slotAddBookmark()),
+ new KAction( i18n("&Bookmark This Link"), "bookmark_add", 0, this, TQT_SLOT(slotAddBookmark()),
mActionCollection, "add_bookmark" );
- new KAction( i18n("&Add to Address Book"), 0, this, SLOT(slotAddToAddressBook()),
+ new KAction( i18n("&Add to Address Book"), 0, this, TQT_SLOT(slotAddToAddressBook()),
mActionCollection, "add_addr_book" );
- new KAction( i18n("&Open in Address Book"), 0, this, SLOT(slotOpenInAddressBook()),
+ new KAction( i18n("&Open in Address Book"), 0, this, TQT_SLOT(slotOpenInAddressBook()),
mActionCollection, "openin_addr_book" );
- new KAction( i18n("&Open Attachment"), "fileopen", 0, this, SLOT(slotOpenAttachment()),
+ new KAction( i18n("&Open Attachment"), "fileopen", 0, this, TQT_SLOT(slotOpenAttachment()),
mActionCollection, "open_attachment" );
- new KAction( i18n("&Save Attachment As..."), "filesaveas", 0, this, SLOT(slotSaveAttachment()),
+ new KAction( i18n("&Save Attachment As..."), "filesaveas", 0, this, TQT_SLOT(slotSaveAttachment()),
mActionCollection, "save_attachment" );
}
@@ -288,13 +288,13 @@ void ArticleWidget::readConfig()
mAttachmentStyle = conf->readEntry( "attachmentStyle", "inline" );
mHeaderStyle = conf->readEntry( "headerStyle", "fancy" );
KRadioAction *ra = 0;
- ra = static_cast<KRadioAction*>( mActionCollection->action( QString("view_attachments_%1").arg(mAttachmentStyle).latin1() ) );
+ ra = static_cast<KRadioAction*>( mActionCollection->action( TQString("view_attachments_%1").arg(mAttachmentStyle).latin1() ) );
ra->setChecked( true );
- ra = static_cast<KRadioAction*>( mActionCollection->action( QString("view_headers_%1").arg(mHeaderStyle).latin1() ) );
+ ra = static_cast<KRadioAction*>( mActionCollection->action( TQString("view_headers_%1").arg(mHeaderStyle).latin1() ) );
ra->setChecked( true );
delete mCSSHelper;
- mCSSHelper = new CSSHelper( QPaintDeviceMetrics( mViewer->view() ) );
+ mCSSHelper = new CSSHelper( TQPaintDeviceMetrics( mViewer->view() ) );
if ( !knGlobals.configManager()->readNewsGeneral()->autoMark() )
mTimer->stop();
@@ -391,29 +391,29 @@ void ArticleWidget::displayArticle()
displayHeader();
// body
- QString html;
+ TQString html;
KMime::Content *text = mArticle->textContent();
// check if codec is available
if ( text && !canDecodeText( text->contentType()->charset() ) ) {
- html += QString("<table width=\"100%\" border=\"0\"><tr><td bgcolor=\"#FF0000\">%1</td></tr></table>")
+ html += TQString("<table width=\"100%\" border=\"0\"><tr><td bgcolor=\"#FF0000\">%1</td></tr></table>")
.arg( i18n("Unknown charset. Default charset is used instead.") );
kdDebug(5003) << k_funcinfo << "unknown charset = " << text->contentType()->charset() << endl;
}
// if the article is pgp signed and the user asked for verifying the
// signature, we show a nice header:
- QPtrList<Kpgp::Block> pgpBlocks;
- QStrList nonPgpBlocks;
+ TQPtrList<Kpgp::Block> pgpBlocks;
+ TQStrList nonPgpBlocks;
bool containsPGP = Kpgp::Module::prepareMessageForDecryption( mArticle->body(), pgpBlocks, nonPgpBlocks );
mViewer->write ( html );
- html = QString();
+ html = TQString();
if ( containsPGP ) {
- QPtrListIterator<Kpgp::Block> pbit( pgpBlocks );
- QStrListIterator npbit( nonPgpBlocks );
- QTextCodec *codec;
+ TQPtrListIterator<Kpgp::Block> pbit( pgpBlocks );
+ TQStrListIterator npbit( nonPgpBlocks );
+ TQTextCodec *codec;
if ( text )
codec = KGlobal::charsets()->codecForName( text->contentType()->charset() );
else
@@ -421,18 +421,18 @@ void ArticleWidget::displayArticle()
for( ; *pbit != 0; ++pbit, ++npbit ) {
// handle non-pgp block
- QCString str( *npbit );
+ TQCString str( *npbit );
if( !str.isEmpty() ) {
- QStringList lines = QStringList::split( '\n', codec->toUnicode( str ), true );
+ TQStringList lines = TQStringList::split( '\n', codec->toUnicode( str ), true );
displayBodyBlock( lines );
}
// handle pgp block
Kpgp::Block* block = *pbit;
if ( block->type() == Kpgp::ClearsignedBlock )
block->verify();
- QStringList lines = QStringList::split( '\n', codec->toUnicode( block->text() ), true );
+ TQStringList lines = TQStringList::split( '\n', codec->toUnicode( block->text() ), true );
if ( block->isSigned() ) {
- QString signClass = displaySigHeader( block );
+ TQString signClass = displaySigHeader( block );
displayBodyBlock( lines );
displaySigFooter( signClass );
} else {
@@ -440,9 +440,9 @@ void ArticleWidget::displayArticle()
}
}
// deal with the last non-pgp block
- QCString str( *npbit );
+ TQCString str( *npbit );
if( !str.isEmpty() ) {
- QStringList lines = QStringList::split( '\n', codec->toUnicode( str ), true );
+ TQStringList lines = TQStringList::split( '\n', codec->toUnicode( str ), true );
displayBodyBlock( lines );
}
}
@@ -464,7 +464,7 @@ void ArticleWidget::displayArticle()
if ( text && text->hasContent() && !ct->isPartial() ) {
// handle HTML messages
if ( text->contentType()->isHTMLText() ) {
- QString htmlTxt;
+ TQString htmlTxt;
text->decodedText( htmlTxt, true, knGlobals.configManager()->readNewsViewer()->removeTrailingNewlines() );
if ( mShowHtml ) {
// strip </html> & </body>
@@ -486,7 +486,7 @@ void ArticleWidget::displayArticle()
}
else {
if ( !containsPGP ) {
- QStringList lines;
+ TQStringList lines;
text->decodedText( lines, true, knGlobals.configManager()->readNewsViewer()->removeTrailingNewlines() );
displayBodyBlock( lines );
}
@@ -513,12 +513,12 @@ void ArticleWidget::displayArticle()
}
-void ArticleWidget::displayErrorMessage( const QString &msg )
+void ArticleWidget::displayErrorMessage( const TQString &msg )
{
mViewer->begin();
mViewer->setUserStyleSheet( mCSSHelper->cssDefinitions( mFixedFontToggle->isChecked() ) );
mViewer->write( mCSSHelper->htmlHead( mFixedFontToggle->isChecked() ) );
- QString errMsg = msg;
+ TQString errMsg = msg;
mViewer->write( "<b><font size=\"+1\" color=\"red\">" );
mViewer->write( i18n("An error occurred.") );
mViewer->write( "</font></b><hr/><br/>" );
@@ -542,18 +542,18 @@ void ArticleWidget::displayErrorMessage( const QString &msg )
void ArticleWidget::displayHeader()
{
- QString headerHtml;
+ TQString headerHtml;
// full header style
if ( mHeaderStyle == "all" ) {
- QCString head = mArticle->head();
+ TQCString head = mArticle->head();
KMime::Headers::Generic *header = 0;
while ( !head.isEmpty() ) {
header = mArticle->getNextHeader( head );
if ( header ) {
headerHtml += "<tr>";
- headerHtml+=QString( "<td align=\"right\" valign=\"top\"><b>%1</b></td><td width=\"100%\">%2</td></tr>" )
+ headerHtml+=TQString( "<td align=\"right\" valign=\"top\"><b>%1</b></td><td width=\"100%\">%2</td></tr>" )
.arg( toHtmlString( header->type(), None ) + ": " )
.arg( toHtmlString( header->asUnicodeString() , ParseURL ) );
delete header;
@@ -569,8 +569,8 @@ void ArticleWidget::displayHeader()
// standard & fancy header style
KMime::Headers::Base *hb;
- QValueList<KNDisplayedHeader*> dhs = knGlobals.configManager()->displayedHeaders()->headers();
- for ( QValueList<KNDisplayedHeader*>::Iterator it = dhs.begin(); it != dhs.end(); ++it ) {
+ TQValueList<KNDisplayedHeader*> dhs = knGlobals.configManager()->displayedHeaders()->headers();
+ for ( TQValueList<KNDisplayedHeader*>::Iterator it = dhs.begin(); it != dhs.end(); ++it ) {
KNDisplayedHeader *dh = (*it);
hb = mArticle->getHeaderByType(dh->header().latin1());
if ( !hb || hb->is("Subject") || hb->is("Organization") )
@@ -589,7 +589,7 @@ void ArticleWidget::displayHeader()
headerHtml+="<tr><td colspan=\"2\">";
if ( hb->is("From") ) {
- headerHtml += QString( "<a href=\"mailto:%1\">%2</a>")
+ headerHtml += TQString( "<a href=\"mailto:%1\">%2</a>")
.arg( KPIM::getEmailAddress( hb->asUnicodeString() ) )
.arg( toHtmlString( hb->asUnicodeString(), None ) );
KMime::Headers::Base *orgHdr = mArticle->getHeaderByType( "Organization" );
@@ -602,7 +602,7 @@ void ArticleWidget::displayHeader()
KMime::Headers::Date *date=static_cast<KMime::Headers::Date*>(hb);
headerHtml += toHtmlString( KGlobal::locale()->formatDateTime(date->qdt(), false, true), None );
} else if ( hb->is("Newsgroups") ) {
- QString groups = hb->asUnicodeString();
+ TQString groups = hb->asUnicodeString();
groups.replace( ',', ", " );
headerHtml += toHtmlString( groups, ParseURL );
} else
@@ -621,24 +621,24 @@ void ArticleWidget::displayHeader()
}
// X-Face support
- QString xfhead;
+ TQString xfhead;
KMime::Headers::Base *temp = mArticle->getHeaderByType("X-Face");
if (temp)
xfhead = temp->asUnicodeString();
- QString xface = "";
+ TQString xface = "";
if ( !xfhead.isEmpty() ) {
KPIM::KXFace xf;
- xface = QString::fromLatin1( "<div class=\"senderpic\"><img src=\"%1\" width=\"48\" height=\"48\"/></div>" )
+ xface = TQString::fromLatin1( "<div class=\"senderpic\"><img src=\"%1\" width=\"48\" height=\"48\"/></div>" )
.arg( imgToDataUrl( xf.toImage( xfhead ), "PNG" ) );
}
// fancy header style
mViewer->write( "<div class=\"fancy header\"" );
- mViewer->write( QString("<div>") );
+ mViewer->write( TQString("<div>") );
mViewer->write( toHtmlString( mArticle->subject()->asUnicodeString(), ParseURL | FancyFormatting ) );
- mViewer->write( QString("</div>") );
+ mViewer->write( TQString("</div>") );
- QString html = QString("<table class=\"outer\"><tr><td width=\"100%\"><table>");
+ TQString html = TQString("<table class=\"outer\"><tr><td width=\"100%\"><table>");
html += headerHtml;
html+="</td></tr></table></td>";
@@ -651,12 +651,12 @@ void ArticleWidget::displayHeader()
&& knGlobals.configManager()->readNewsViewer()->showRefBar() ) {
html += "<div class=\"spamheader\">";
int refCnt = refs->count(), i = 1;
- QCString id = refs->first();
+ TQCString id = refs->first();
id = id.mid( 1, id.length() - 2 ); // remove <>
- html += QString( "<b>%1</b>" ).arg( i18n("References:") );
+ html += TQString( "<b>%1</b>" ).arg( i18n("References:") );
while ( i <= refCnt ) {
- html += " <a href=\"news:" + QString::fromLatin1( id ) + "\">" + QString::number( i ) + "</a>";
+ html += " <a href=\"news:" + TQString::fromLatin1( id ) + "\">" + TQString::number( i ) + "</a>";
id = refs->next();
id = id.mid( 1, id.length() - 2 ); // remove <>
i++;
@@ -669,17 +669,17 @@ void ArticleWidget::displayHeader()
}
-void ArticleWidget::displayBodyBlock( const QStringList &lines )
+void ArticleWidget::displayBodyBlock( const TQStringList &lines )
{
int oldLevel = -2, newLevel = -2;
bool isSig = false;
- QString line, html;
+ TQString line, html;
KNConfig::ReadNewsViewer *rnv = knGlobals.configManager()->readNewsViewer();
- QString quoteChars = rnv->quoteCharacters().simplifyWhiteSpace();
+ TQString quoteChars = rnv->quoteCharacters().simplifyWhiteSpace();
if (quoteChars.isEmpty())
quoteChars = ">";
- for ( QStringList::const_iterator it = lines.begin(); it != lines.end(); ++it) {
+ for ( TQStringList::const_iterator it = lines.begin(); it != lines.end(); ++it) {
line = (*it);
if ( !line.isEmpty() ) {
// signature found
@@ -732,12 +732,12 @@ void ArticleWidget::displayBodyBlock( const QStringList &lines )
}
-QString ArticleWidget::displaySigHeader( Kpgp::Block* block )
+TQString ArticleWidget::displaySigHeader( Kpgp::Block* block )
{
- QString signClass = "signErr";
- QString signer = block->signatureUserId();
- QCString signerKey = block->signatureKeyId();
- QString message;
+ TQString signClass = "signErr";
+ TQString signer = block->signatureUserId();
+ TQCString signerKey = block->signatureKeyId();
+ TQString message;
if ( signer.isEmpty() ) {
message = i18n( "Message was signed with unknown key 0x%1." )
.arg( signerKey );
@@ -799,7 +799,7 @@ QString ArticleWidget::displaySigHeader( Kpgp::Block* block )
}
}
- QString html = "<table cellspacing=\"1\" cellpadding=\"1\" class=\"" + signClass + "\">";
+ TQString html = "<table cellspacing=\"1\" cellpadding=\"1\" class=\"" + signClass + "\">";
html += "<tr class=\"" + signClass + "H\"><td>";
html += message;
html += "</td></tr><tr class=\"" + signClass + "B\"><td>";
@@ -808,9 +808,9 @@ QString ArticleWidget::displaySigHeader( Kpgp::Block* block )
}
-void ArticleWidget::displaySigFooter( const QString &signClass )
+void ArticleWidget::displaySigFooter( const TQString &signClass )
{
- QString html = "</td></tr><tr class=\"" + signClass + "H\">";
+ TQString html = "</td></tr><tr class=\"" + signClass + "H\">";
html += "<td>" + i18n( "End of signed message" ) + "</td></tr></table>";
mViewer->write( html );
}
@@ -821,26 +821,26 @@ void ArticleWidget::displayAttachment( KMime::Content *att, int partNum )
if ( mAttachmentStyle == "hide" )
return;
- QString html;
+ TQString html;
KMime::Headers::ContentType *ct = att->contentType();
// attachment label
- QString label = ct->name();
+ TQString label = ct->name();
if ( label.isEmpty() )
label = i18n("unnamed" );
// if label consists of only whitespace replace them by underscores
if ( (uint)label.contains( ' ' ) == label.length() )
- label.replace( QRegExp( " ", true, true ), "_" );
+ label.replace( TQRegExp( " ", true, true ), "_" );
label = toHtmlString( label, None );
// attachment comment
- QString comment = att->contentDescription()->asUnicodeString();
+ TQString comment = att->contentDescription()->asUnicodeString();
comment = toHtmlString( comment, ParseURL | FancyFormatting );
- QString href;
- QString fileName = writeAttachmentToTempFile( att, partNum );
+ TQString href;
+ TQString fileName = writeAttachmentToTempFile( att, partNum );
if ( fileName.isEmpty() ) {
- href = "part://" + QString::number( partNum );
+ href = "part://" + TQString::number( partNum );
} else {
href = "file:" + KURL::encode_string( fileName );
mAttachementMap[fileName] = partNum;
@@ -861,7 +861,7 @@ void ArticleWidget::displayAttachment( KMime::Content *att, int partNum )
html += "<br>" + comment;
html += "</td></tr><tr class=\"textAtmB\"><td>";
// content
- QString tmp;
+ TQString tmp;
att->decodedText( tmp );
/*if( ct->isHTMLText() )
// ### to dangerous, we should use the same stuff as for the main text here
@@ -872,10 +872,10 @@ void ArticleWidget::displayAttachment( KMime::Content *att, int partNum )
html += "</td></tr></table>";
}
} else { // icon
- QCString mimetype = ct->mimeType();
+ TQCString mimetype = ct->mimeType();
KPIM::kAsciiToLower( mimetype.data() );
- QString iconName = KMimeType::mimeType( mimetype )->icon( QString::null, false );
- QString iconFile = KGlobal::instance()->iconLoader()->iconPath( iconName, KIcon::Desktop );
+ TQString iconName = KMimeType::mimeType( mimetype )->icon( TQString::null, false );
+ TQString iconFile = KGlobal::instance()->iconLoader()->iconPath( iconName, KIcon::Desktop );
html += "<div><a href=\"" + href + "\"><img src=\"" +
iconFile + "\" border=\"0\">" + label +
"</a></div><div>" + comment + "</div><br>";
@@ -884,14 +884,14 @@ void ArticleWidget::displayAttachment( KMime::Content *att, int partNum )
}
-QString ArticleWidget::toHtmlString( const QString &line, int flags )
+TQString ArticleWidget::toHtmlString( const TQString &line, int flags )
{
int llflags = LinkLocator::PreserveSpaces;
if ( !(flags & ArticleWidget::ParseURL) )
llflags |= LinkLocator::IgnoreUrls;
if ( mFancyToggle->isChecked() && (flags & ArticleWidget::FancyFormatting) )
llflags |= LinkLocator::ReplaceSmileys | LinkLocator::HighlightText;
- QString text = line;
+ TQString text = line;
if ( flags & ArticleWidget::AllowROT13 ) {
if ( mRot13 )
text = KNHelper::rot13( line );
@@ -901,19 +901,19 @@ QString ArticleWidget::toHtmlString( const QString &line, int flags )
// from KMail headerstyle.cpp
-QString ArticleWidget::imgToDataUrl( const QImage &image, const char* fmt )
+TQString ArticleWidget::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 ) );
}
-int ArticleWidget::quotingDepth( const QString &line, const QString &quoteChars )
+int ArticleWidget::quotingDepth( const TQString &line, const TQString &quoteChars )
{
int level = -1;
for ( uint i = 0; i < line.length(); ++i ) {
@@ -936,7 +936,7 @@ bool ArticleWidget::inlinePossible( KMime::Content *c )
}
-bool ArticleWidget::canDecodeText( const QCString &charset ) const
+bool ArticleWidget::canDecodeText( const TQCString &charset ) const
{
if ( charset.isEmpty() )
return false;
@@ -961,26 +961,26 @@ void ArticleWidget::updateContents()
-QString ArticleWidget::writeAttachmentToTempFile( KMime::Content *att, int partNum )
+TQString ArticleWidget::writeAttachmentToTempFile( KMime::Content *att, int partNum )
{
// more or less KMail code
- KTempFile *tempFile = new KTempFile( QString::null, "." + QString::number( partNum ) );
+ KTempFile *tempFile = new KTempFile( TQString::null, "." + TQString::number( partNum ) );
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
Q_ASSERT( !fname.isNull() );
mTempDirs.append( fname );
// strip off a leading path
KMime::Headers::ContentType* ct = att->contentType();
- QString attName = ct->name();
+ TQString attName = ct->name();
int slashPos = attName.findRev( '/' );
if( -1 != slashPos )
attName = attName.mid( slashPos + 1 );
@@ -988,16 +988,16 @@ QString ArticleWidget::writeAttachmentToTempFile( KMime::Content *att, int partN
attName = "unnamed";
fname += "/" + attName;
- QByteArray data = att->decodedContent();
+ TQByteArray data = att->decodedContent();
size_t size = data.size();
// ### KMail does crlf2lf conversion here before writing the file
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
- ::chmod( QFile::encodeName( fname ), S_IRUSR );
+ ::chmod( TQFile::encodeName( fname ), S_IRUSR );
return fname;
}
@@ -1005,11 +1005,11 @@ QString ArticleWidget::writeAttachmentToTempFile( KMime::Content *att, int partN
void ArticleWidget::removeTempFiles( )
{
- for ( QStringList::Iterator it = mTempFiles.begin(); it != mTempFiles.end(); ++it )
- QFile::remove(*it);
+ for ( TQStringList::Iterator it = mTempFiles.begin(); it != mTempFiles.end(); ++it )
+ TQFile::remove(*it);
mTempFiles.clear();
- for ( QStringList::Iterator it = mTempDirs.begin(); it != mTempDirs.end(); ++it )
- QDir(*it).rmdir(*it);
+ for ( TQStringList::Iterator it = mTempDirs.begin(); it != mTempDirs.end(); ++it )
+ TQDir(*it).rmdir(*it);
mTempDirs.clear();
}
@@ -1035,7 +1035,7 @@ void ArticleWidget::processJob( KNJobData * job )
-typedef QValueList<ArticleWidget*>::ConstIterator InstanceIterator;
+typedef TQValueList<ArticleWidget*>::ConstIterator InstanceIterator;
void ArticleWidget::configChanged()
{
@@ -1071,7 +1071,7 @@ void ArticleWidget::articleChanged( KNArticle *article )
}
-void ArticleWidget::articleLoadError( KNArticle *article, const QString &error )
+void ArticleWidget::articleLoadError( KNArticle *article, const TQString &error )
{
for ( InstanceIterator it = mInstances.begin(); it != mInstances.end(); ++it )
if ( (*it)->article() == article )
@@ -1171,10 +1171,10 @@ void ArticleWidget::slotURLClicked( const KURL &url, bool forceOpen)
}
-void ArticleWidget::slotURLPopup( const QString &url, const QPoint &point )
+void ArticleWidget::slotURLPopup( const TQString &url, const TQPoint &point )
{
mCurrentURL = KURL( url );
- QString popupName;
+ TQString popupName;
if ( url.isEmpty() ) // plain text
popupName = "body_popup";
else if ( mCurrentURL.protocol() == "mailto" )
@@ -1186,7 +1186,7 @@ void ArticleWidget::slotURLPopup( const QString &url, const QPoint &point )
return; // skip
else
popupName = "url_popup"; // all other URLs
- QPopupMenu *popup = static_cast<QPopupMenu*>( mGuiClient->factory()->container( popupName, mGuiClient ) );
+ TQPopupMenu *popup = static_cast<TQPopupMenu*>( mGuiClient->factory()->container( popupName, mGuiClient ) );
if ( popup )
popup->popup( point );
}
@@ -1354,7 +1354,7 @@ void ArticleWidget::slotToggleRot13()
-void ArticleWidget::slotSetCharset( const QString &charset )
+void ArticleWidget::slotSetCharset( const TQString &charset )
{
if ( charset.isEmpty() )
return;
@@ -1394,20 +1394,20 @@ void ArticleWidget::slotOpenURL()
void ArticleWidget::slotCopyURL()
{
- QString address;
+ TQString address;
if ( mCurrentURL.protocol() == "mailto" )
address = mCurrentURL.path();
else
address = mCurrentURL.url();
- QApplication::clipboard()->setText( address, QClipboard::Clipboard );
- QApplication::clipboard()->setText( address, QClipboard::Selection );
+ TQApplication::clipboard()->setText( address, QClipboard::Clipboard );
+ TQApplication::clipboard()->setText( address, QClipboard::Selection );
}
void ArticleWidget::slotAddBookmark()
{
if ( mCurrentURL.isEmpty() )
return;
- QString filename = locateLocal( "data", QString::fromLatin1("konqueror/bookmarks.xml") );
+ TQString filename = locateLocal( "data", TQString::fromLatin1("konqueror/bookmarks.xml") );
KBookmarkManager *bookManager = KBookmarkManager::managerForFile( filename, false );
KBookmarkGroup group = bookManager->root();
group.addBookmark( bookManager, mCurrentURL.url(), mCurrentURL );
@@ -1449,26 +1449,26 @@ void ArticleWidget::slotSaveAttachment()
-void ArticleWidget::focusInEvent( QFocusEvent *e )
+void ArticleWidget::focusInEvent( TQFocusEvent *e )
{
emit focusChanged(e);
- QWidget::focusInEvent(e);
+ TQWidget::focusInEvent(e);
}
-void ArticleWidget::focusOutEvent( QFocusEvent *e )
+void ArticleWidget::focusOutEvent( TQFocusEvent *e )
{
emit focusChanged(e);
- QWidget::focusOutEvent(e);
+ TQWidget::focusOutEvent(e);
}
-bool ArticleWidget::eventFilter( QObject *o, QEvent *e )
+bool ArticleWidget::eventFilter( TQObject *o, TQEvent *e )
{
- if ( e->type() == QEvent::KeyPress && (static_cast<QKeyEvent*>(e)->key() == Key_Tab) ) {
+ if ( e->type() == TQEvent::KeyPress && (static_cast<TQKeyEvent*>(e)->key() == Key_Tab) ) {
emit focusChangeRequest( this );
if ( !hasFocus() ) // focusChangeRequest was successful
return true;
}
- return QWidget::eventFilter(o, e);
+ return TQWidget::eventFilter(o, e);
}
#include "articlewidget.moc"