diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
commit | cc29364f06178f8f6b457384f2ec37a042bd9d43 (patch) | |
tree | 7c77a3184c698bbf9d98cef09fb1ba8124daceba /knode/articlewidget.cpp | |
parent | 4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff) | |
download | tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip |
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed
* Added journal read support to the CalDAV resource
* Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'knode/articlewidget.cpp')
-rw-r--r-- | knode/articlewidget.cpp | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/knode/articlewidget.cpp b/knode/articlewidget.cpp index 1bb7527fe..357a9c009 100644 --- a/knode/articlewidget.cpp +++ b/knode/articlewidget.cpp @@ -278,10 +278,12 @@ void ArticleWidget::disableActions() void ArticleWidget::readConfig() { - mFixedFontToggle->setChecked( knGlobals.configManager()->readNewsViewer()->useFixedFont() ); - mFancyToggle->setChecked( knGlobals.configManager()->readNewsViewer()->interpretFormatTags() ); + KNConfigManager *cfgMgr = knGlobals.configManager(); - mShowHtml = knGlobals.configManager()->readNewsViewer()->alwaysShowHTML(); + mFixedFontToggle->setChecked( cfgMgr->readNewsViewer()->useFixedFont() ); + mFancyToggle->setChecked( cfgMgr->readNewsViewer()->interpretFormatTags() ); + + mShowHtml = cfgMgr->readNewsViewer()->alwaysShowHTML(); KConfig *conf = knGlobals.config(); conf->setGroup( "READNEWS" ); @@ -296,7 +298,7 @@ void ArticleWidget::readConfig() delete mCSSHelper; mCSSHelper = new CSSHelper( TQPaintDeviceMetrics( mViewer->view() ) ); - if ( !knGlobals.configManager()->readNewsGeneral()->autoMark() ) + if ( !cfgMgr->readNewsGeneral()->autoMark() ) mTimer->stop(); } @@ -312,8 +314,9 @@ void ArticleWidget::writeConfig() conf->writeEntry( "attachmentStyle", mAttachmentStyle ); conf->writeEntry( "headerStyle", mHeaderStyle ); - knGlobals.configManager()->readNewsViewer()->setUseFixedFont( mFixedFontToggle->isChecked() ); - knGlobals.configManager()->readNewsViewer()->setInterpretFormatTags( mFancyToggle->isChecked() ); + KNConfigManager *cfgMgr = knGlobals.configManager(); + cfgMgr->readNewsViewer()->setUseFixedFont( mFixedFontToggle->isChecked() ); + cfgMgr->readNewsViewer()->setInterpretFormatTags( mFancyToggle->isChecked() ); } @@ -324,7 +327,8 @@ void ArticleWidget::setArticle( KNArticle *article ) if ( mArticle && mArticle->isOrphant() ) delete mArticle; - mShowHtml = knGlobals.configManager()->readNewsViewer()->alwaysShowHTML(); + KNConfigManager *cfgMgr = knGlobals.configManager(); + mShowHtml = cfgMgr->readNewsViewer()->alwaysShowHTML(); mRot13 = false; mRot13Toggle->setChecked( false ); mTimer->stop(); @@ -380,7 +384,8 @@ void ArticleWidget::displayArticle() mArticle->setForceDefaultCS( mForceCharset ); } - KNConfig::ReadNewsViewer *rnv = knGlobals.configManager()->readNewsViewer(); + KNConfigManager *cfgMgr = knGlobals.configManager(); + KNConfig::ReadNewsViewer *rnv = cfgMgr->readNewsViewer(); removeTempFiles(); mViewer->begin(); @@ -460,12 +465,12 @@ void ArticleWidget::displayArticle() mViewer->write( i18n("<br/><b>This article has the MIME type "message/partial", which KNode cannot handle yet.<br>Meanwhile you can save the article as a text file and reassemble it by hand.</b>") ); } - // display body text + // display body text if ( text && text->hasContent() && !ct->isPartial() ) { // handle HTML messages if ( text->contentType()->isHTMLText() ) { TQString htmlTxt; - text->decodedText( htmlTxt, true, knGlobals.configManager()->readNewsViewer()->removeTrailingNewlines() ); + text->decodedText( htmlTxt, true, cfgMgr->readNewsViewer()->removeTrailingNewlines() ); if ( mShowHtml ) { // strip </html> & </body> int i = kMin( htmlTxt.findRev( "</html>", -1, false ), htmlTxt.findRev( "</body>", -1, false ) ); @@ -487,7 +492,7 @@ void ArticleWidget::displayArticle() else { if ( !containsPGP ) { TQStringList lines; - text->decodedText( lines, true, knGlobals.configManager()->readNewsViewer()->removeTrailingNewlines() ); + text->decodedText( lines, true, cfgMgr->readNewsViewer()->removeTrailingNewlines() ); displayBodyBlock( lines ); } } @@ -508,8 +513,8 @@ void ArticleWidget::displayArticle() mViewer->end(); enableActions(); - if( mArticle->type() == KMime::Base::ATremote && knGlobals.configManager()->readNewsGeneral()->autoMark() ) - mTimer->start( knGlobals.configManager()->readNewsGeneral()->autoMarkSeconds() * 1000, true ); + if( mArticle->type() == KMime::Base::ATremote && cfgMgr->readNewsGeneral()->autoMark() ) + mTimer->start( cfgMgr->readNewsGeneral()->autoMarkSeconds() * 1000, true ); } @@ -527,7 +532,8 @@ void ArticleWidget::displayErrorMessage( const TQString &msg ) mViewer->end(); // mark article as read if there is a negative reply from the server - if ( knGlobals.configManager()->readNewsGeneral()->autoMark() && + KNConfigManager *cfgMgr = knGlobals.configManager(); + if ( cfgMgr->readNewsGeneral()->autoMark() && mArticle && mArticle->type() == KMime::Base::ATremote && !mArticle->isOrphant() && ( msg.find("430") != -1 || msg.find("423") != -1 ) ) { KNRemoteArticle::List l; @@ -569,7 +575,8 @@ void ArticleWidget::displayHeader() // standard & fancy header style KMime::Headers::Base *hb; - TQValueList<KNDisplayedHeader*> dhs = knGlobals.configManager()->displayedHeaders()->headers(); + KNConfigManager *cfgMgr = knGlobals.configManager(); + TQValueList<KNDisplayedHeader*> dhs = cfgMgr->displayedHeaders()->headers(); for ( TQValueList<KNDisplayedHeader*>::Iterator it = dhs.begin(); it != dhs.end(); ++it ) { KNDisplayedHeader *dh = (*it); hb = mArticle->getHeaderByType(dh->header().latin1()); @@ -648,7 +655,7 @@ void ArticleWidget::displayHeader() // references KMime::Headers::References *refs = mArticle->references( false ); if ( mArticle->type() == KMime::Base::ATremote && refs - && knGlobals.configManager()->readNewsViewer()->showRefBar() ) { + && cfgMgr->readNewsViewer()->showRefBar() ) { html += "<div class=\"spamheader\">"; int refCnt = refs->count(), i = 1; TQCString id = refs->first(); @@ -674,7 +681,8 @@ void ArticleWidget::displayBodyBlock( const TQStringList &lines ) int oldLevel = -2, newLevel = -2; bool isSig = false; TQString line, html; - KNConfig::ReadNewsViewer *rnv = knGlobals.configManager()->readNewsViewer(); + KNConfigManager *cfgMgr = knGlobals.configManager(); + KNConfig::ReadNewsViewer *rnv = cfgMgr->readNewsViewer(); TQString quoteChars = rnv->quoteCharacters().simplifyWhiteSpace(); if (quoteChars.isEmpty()) quoteChars = ">"; @@ -1160,7 +1168,8 @@ void ArticleWidget::slotURLClicked( const KURL &url, bool forceOpen) if ( !c ) return; // TODO: replace with message box as done in KMail - if ( forceOpen || knGlobals.configManager()->readNewsViewer()->openAttachmentsOnClick() ) + KNConfigManager *cfgMgr = knGlobals.configManager(); + if ( forceOpen || cfgMgr->readNewsViewer()->openAttachmentsOnClick() ) knGlobals.articleManager()->openContent( c ); else knGlobals.articleManager()->saveContentToFile( c, this ); |