summaryrefslogtreecommitdiffstats
path: root/kmail/kmreaderwin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/kmreaderwin.cpp')
-rw-r--r--kmail/kmreaderwin.cpp204
1 files changed, 113 insertions, 91 deletions
diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp
index 184167b0..8ada99f4 100644
--- a/kmail/kmreaderwin.cpp
+++ b/kmail/kmreaderwin.cpp
@@ -385,7 +385,7 @@ kdDebug(5006) << " Root node will NOT be replaced." << endl
void KMReaderWin::createWidgets() {
TQVBoxLayout * vlay = new TQVBoxLayout( this );
- mSplitter = new TQSplitter( Qt::Vertical, this, "mSplitter" );
+ mSplitter = new TQSplitter( TQt::Vertical, this, "mSplitter" );
vlay->addWidget( mSplitter );
mMimePartTree = new KMMimePartTree( this, mSplitter, "mMimePartTree" );
mBox = new TQHBox( mSplitter, "mBox" );
@@ -464,18 +464,19 @@ KMReaderWin::KMReaderWin(TQWidget *aParent,
readConfig();
mHtmlOverride = false;
+ mHtmlLoadExtDefault = false;
mHtmlLoadExtOverride = false;
mLevelQuote = GlobalSettings::self()->collapseQuoteLevelSpin() - 1;
- connect( &mUpdateReaderWinTimer, TQT_SIGNAL(timeout()),
- TQT_TQOBJECT(this), TQT_SLOT(updateReaderWin()) );
- connect( &mResizeTimer, TQT_SIGNAL(timeout()),
- TQT_TQOBJECT(this), TQT_SLOT(slotDelayedResize()) );
- connect( &mDelayedMarkTimer, TQT_SIGNAL(timeout()),
- TQT_TQOBJECT(this), TQT_SLOT(slotTouchMessage()) );
- connect( &mHeaderRefreshTimer, TQT_SIGNAL(timeout()),
- TQT_TQOBJECT(this), TQT_SLOT(updateHeader()) );
+ connect( &mUpdateReaderWinTimer, TQ_SIGNAL(timeout()),
+ this, TQ_SLOT(updateReaderWin()) );
+ connect( &mResizeTimer, TQ_SIGNAL(timeout()),
+ this, TQ_SLOT(slotDelayedResize()) );
+ connect( &mDelayedMarkTimer, TQ_SIGNAL(timeout()),
+ this, TQ_SLOT(slotTouchMessage()) );
+ connect( &mHeaderRefreshTimer, TQ_SIGNAL(timeout()),
+ this, TQ_SLOT(updateHeader()) );
}
@@ -490,46 +491,46 @@ void KMReaderWin::createActions( TDEActionCollection * ac ) {
new TDEActionMenu( i18n("View->", "&Headers"), ac, "view_headers" );
headerMenu->setToolTip( i18n("Choose display style of message headers") );
- connect( headerMenu, TQT_SIGNAL(activated()),
- TQT_TQOBJECT(this), TQT_SLOT(slotCycleHeaderStyles()) );
+ connect( headerMenu, TQ_SIGNAL(activated()),
+ this, TQ_SLOT(slotCycleHeaderStyles()) );
raction = new TDERadioAction( i18n("View->headers->", "&Enterprise Headers"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(slotEnterpriseHeaders()),
+ this, TQ_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 TDERadioAction( i18n("View->headers->", "&Fancy Headers"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(slotFancyHeaders()),
+ this, TQ_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 TDERadioAction( i18n("View->headers->", "&Brief Headers"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(slotBriefHeaders()),
+ this, TQ_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 TDERadioAction( i18n("View->headers->", "&Standard Headers"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(slotStandardHeaders()),
+ this, TQ_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 TDERadioAction( i18n("View->headers->", "&Long Headers"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(slotLongHeaders()),
+ this, TQ_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 TDERadioAction( i18n("View->headers->", "&All Headers"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(slotAllHeaders()),
+ this, TQ_SLOT(slotAllHeaders()),
ac, "view_headers_all" );
raction->setToolTip( i18n("Show all message headers") );
raction->setExclusiveGroup( "view_headers_group" );
@@ -539,39 +540,39 @@ void KMReaderWin::createActions( TDEActionCollection * ac ) {
TDEActionMenu *attachmentMenu =
new TDEActionMenu( i18n("View->", "&Attachments"), ac, "view_attachments" );
attachmentMenu->setToolTip( i18n("Choose display style of attachments") );
- connect( attachmentMenu, TQT_SIGNAL(activated()),
- TQT_TQOBJECT(this), TQT_SLOT(slotCycleAttachmentStrategy()) );
+ connect( attachmentMenu, TQ_SIGNAL(activated()),
+ this, TQ_SLOT(slotCycleAttachmentStrategy()) );
raction = new TDERadioAction( i18n("View->attachments->", "&As Icons"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(slotIconicAttachments()),
+ this, TQ_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 TDERadioAction( i18n("View->attachments->", "&Smart"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(slotSmartAttachments()),
+ this, TQ_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 TDERadioAction( i18n("View->attachments->", "&Inline"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(slotInlineAttachments()),
+ this, TQ_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 TDERadioAction( i18n("View->attachments->", "&Hide"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(slotHideAttachments()),
+ this, TQ_SLOT(slotHideAttachments()),
ac, "view_attachments_hide" );
raction->setToolTip( i18n("Do not show attachments in the message viewer") );
raction->setExclusiveGroup( "view_attachments_group" );
attachmentMenu->insert( raction );
mHeaderOnlyAttachmentsAction = new TDERadioAction( i18n( "View->attachments->", "In Header &Only" ), 0,
- TQT_TQOBJECT(this), TQT_SLOT( slotHeaderOnlyAttachments() ),
+ this, TQ_SLOT( slotHeaderOnlyAttachments() ),
ac, "view_attachments_headeronly" );
mHeaderOnlyAttachmentsAction->setToolTip( i18n( "Show Attachments only in the header of the mail" ) );
mHeaderOnlyAttachmentsAction->setExclusiveGroup( "view_attachments_group" );
@@ -579,7 +580,7 @@ void KMReaderWin::createActions( TDEActionCollection * ac ) {
// Set Encoding submenu
mSelectEncodingAction = new TDESelectAction( i18n( "&Set Encoding" ), "charset", 0,
- TQT_TQOBJECT(this), TQT_SLOT( slotSetEncoding() ),
+ this, TQ_SLOT( slotSetEncoding() ),
ac, "encoding" );
TQStringList encodings = KMMsgBase::supportedEncodings( false );
encodings.prepend( i18n( "Auto" ) );
@@ -587,45 +588,45 @@ void KMReaderWin::createActions( TDEActionCollection * ac ) {
mSelectEncodingAction->setCurrentItem( 0 );
mMailToComposeAction = new TDEAction( i18n("New Message To..."), "mail-message-new",
- 0, TQT_TQOBJECT(this), TQT_SLOT(slotMailtoCompose()), ac,
+ 0, this, TQ_SLOT(slotMailtoCompose()), ac,
"mailto_compose" );
mMailToReplyAction = new TDEAction( i18n("Reply To..."), "mail-reply-sender",
- 0, TQT_TQOBJECT(this), TQT_SLOT(slotMailtoReply()), ac,
+ 0, this, TQ_SLOT(slotMailtoReply()), ac,
"mailto_reply" );
mMailToForwardAction = new TDEAction( i18n("Forward To..."), "mail-forward",
- 0, TQT_TQOBJECT(this), TQT_SLOT(slotMailtoForward()), ac,
+ 0, this, TQ_SLOT(slotMailtoForward()), ac,
"mailto_forward" );
mAddAddrBookAction = new TDEAction( i18n("Add to Address Book"),
- 0, TQT_TQOBJECT(this), TQT_SLOT(slotMailtoAddAddrBook()),
+ 0, this, TQ_SLOT(slotMailtoAddAddrBook()),
ac, "add_addr_book" );
mOpenAddrBookAction = new TDEAction( i18n("Open in Address Book"),
- 0, TQT_TQOBJECT(this), TQT_SLOT(slotMailtoOpenAddrBook()),
+ 0, this, TQ_SLOT(slotMailtoOpenAddrBook()),
ac, "openin_addr_book" );
- mCopyAction = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT(slotCopySelectedText()), ac, "kmail_copy");
- mSelectAllAction = new TDEAction( i18n("Select All Text"), CTRL+SHIFT+Key_A, TQT_TQOBJECT(this),
- TQT_SLOT(selectAll()), ac, "mark_all_text" );
- mCopyURLAction = new TDEAction( i18n("Copy Link Address"), 0, TQT_TQOBJECT(this),
- TQT_SLOT(slotUrlCopy()), ac, "copy_url" );
- mUrlOpenAction = new TDEAction( i18n("Open URL"), 0, TQT_TQOBJECT(this),
- TQT_SLOT(slotUrlOpen()), ac, "open_url" );
+ mCopyAction = KStdAction::copy( this, TQ_SLOT(slotCopySelectedText()), ac, "kmail_copy");
+ mSelectAllAction = new TDEAction( i18n("Select All Text"), CTRL+SHIFT+Key_A, this,
+ TQ_SLOT(selectAll()), ac, "mark_all_text" );
+ mCopyURLAction = new TDEAction( i18n("Copy Link Address"), 0, this,
+ TQ_SLOT(slotUrlCopy()), ac, "copy_url" );
+ mUrlOpenAction = new TDEAction( i18n("Open URL"), 0, this,
+ TQ_SLOT(slotUrlOpen()), ac, "open_url" );
mAddBookmarksAction = new TDEAction( i18n("Bookmark This Link"),
"bookmark_add",
- 0, TQT_TQOBJECT(this), TQT_SLOT(slotAddBookmarks()),
+ 0, this, TQ_SLOT(slotAddBookmarks()),
ac, "add_bookmarks" );
- mUrlSaveAsAction = new TDEAction( i18n("Save Link As..."), 0, TQT_TQOBJECT(this),
- TQT_SLOT(slotUrlSave()), ac, "saveas_url" );
+ mUrlSaveAsAction = new TDEAction( i18n("Save Link As..."), 0, this,
+ TQ_SLOT(slotUrlSave()), ac, "saveas_url" );
mToggleFixFontAction = new TDEToggleAction( i18n("Use Fi&xed Font"),
- Key_X, TQT_TQOBJECT(this), TQT_SLOT(slotToggleFixedFont()),
+ Key_X, this, TQ_SLOT(slotToggleFixedFont()),
ac, "toggle_fixedfont" );
mToggleMimePartTreeAction = new TDEToggleAction( i18n("Show Message Structure"),
0, ac, "toggle_mimeparttree" );
- connect(mToggleMimePartTreeAction, TQT_SIGNAL(toggled(bool)),
- TQT_TQOBJECT(this), TQT_SLOT(slotToggleMimePartTree()));
+ connect(mToggleMimePartTreeAction, TQ_SIGNAL(toggled(bool)),
+ this, TQ_SLOT(slotToggleMimePartTree()));
- mStartIMChatAction = new TDEAction( i18n("Chat &With..."), 0, TQT_TQOBJECT(this),
- TQT_SLOT(slotIMChat()), ac, "start_im_chat" );
+ mStartIMChatAction = new TDEAction( i18n("Chat &With..."), 0, this,
+ TQ_SLOT(slotIMChat()), ac, "start_im_chat" );
}
// little helper function
@@ -902,7 +903,6 @@ void KMReaderWin::readConfig(void)
mToggleFixFontAction->setChecked( mUseFixedFont );
mHtmlMail = reader.readBoolEntry( "htmlMail", false );
- mHtmlLoadExternal = reader.readBoolEntry( "htmlLoadExternal", false );
setHeaderStyleAndStrategy( HeaderStyle::create( reader.readEntry( "header-style", "fancy" ) ),
HeaderStrategy::create( reader.readEntry( "header-set-displayed", "rich" ) ) );
@@ -1000,7 +1000,7 @@ void KMReaderWin::writeConfig( bool sync ) const {
//-----------------------------------------------------------------------------
void KMReaderWin::initHtmlWidget(void)
{
- mViewer->widget()->setFocusPolicy(TQ_WheelFocus);
+ mViewer->widget()->setFocusPolicy(TQWidget::WheelFocus);
// Let's better be paranoid and disable plugins (it defaults to enabled):
mViewer->setPluginsEnabled(false);
mViewer->setJScriptEnabled(false); // just make this explicit
@@ -1021,17 +1021,17 @@ void KMReaderWin::initHtmlWidget(void)
#endif
connect(mViewer->browserExtension(),
- TQT_SIGNAL(openURLRequest(const KURL &, const KParts::URLArgs &)),this,
- TQT_SLOT(slotUrlOpen(const KURL &)));
+ TQ_SIGNAL(openURLRequest(const KURL &, const KParts::URLArgs &)),this,
+ TQ_SLOT(slotUrlOpen(const KURL &)));
connect(mViewer->browserExtension(),
- TQT_SIGNAL(createNewWindow(const KURL &, const KParts::URLArgs &)),this,
- TQT_SLOT(slotUrlOpen(const KURL &)));
- connect(mViewer,TQT_SIGNAL(popupMenu(const TQString &, const TQPoint &)),
- TQT_SLOT(slotUrlPopup(const TQString &, const TQPoint &)));
- connect( kmkernel->imProxy(), TQT_SIGNAL( sigContactPresenceChanged( const TQString & ) ),
- TQT_TQOBJECT(this), TQT_SLOT( contactStatusChanged( const TQString & ) ) );
- connect( kmkernel->imProxy(), TQT_SIGNAL( sigPresenceInfoExpired() ),
- TQT_TQOBJECT(this), TQT_SLOT( updateReaderWin() ) );
+ TQ_SIGNAL(createNewWindow(const KURL &, const KParts::URLArgs &)),this,
+ TQ_SLOT(slotUrlOpen(const KURL &)));
+ connect(mViewer,TQ_SIGNAL(popupMenu(const TQString &, const TQPoint &)),
+ TQ_SLOT(slotUrlPopup(const TQString &, const TQPoint &)));
+ connect( kmkernel->imProxy(), TQ_SIGNAL( sigContactPresenceChanged( const TQString & ) ),
+ this, TQ_SLOT( contactStatusChanged( const TQString & ) ) );
+ connect( kmkernel->imProxy(), TQ_SIGNAL( sigPresenceInfoExpired() ),
+ this, TQ_SLOT( updateReaderWin() ) );
}
void KMReaderWin::contactStatusChanged( const TQString &uid)
@@ -1408,8 +1408,6 @@ void KMReaderWin::updateReaderWin()
{
if (!mMsgDisplay) return;
- mViewer->setOnlyLocalReferences(!htmlLoadExternal());
-
htmlWriter()->reset();
KMFolder* folder = 0;
@@ -1499,7 +1497,7 @@ void KMReaderWin::displayMessage() {
htmlWriter()->queue("</body></html>");
htmlWriter()->flush();
- TQTimer::singleShot( 1, TQT_TQOBJECT(this), TQT_SLOT(injectAttachments()) );
+ TQTimer::singleShot( 1, this, TQ_SLOT(injectAttachments()) );
}
static bool message_was_saved_decrypted_before( const KMMessage * msg ) {
@@ -1579,6 +1577,7 @@ void KMReaderWin::parseMsg(KMMessage* aMsg)
// - this can only be done *after* calling parseObjectTree()
KMMsgEncryptionState encryptionState = mRootNode->overallEncryptionState();
KMMsgSignatureState signatureState = mRootNode->overallSignatureState();
+ mViewer->setOnlyLocalReferences(!htmlLoadExternal());
// Don't crash when switching message while GPG passphrase entry dialog is shown #53185
if (aMsg != message()) {
displayMessage();
@@ -1776,8 +1775,12 @@ TQString KMReaderWin::writeMessagePartToTempFile( KMMessagePart* aMsgPart,
int slashPos = fileName.findRev( '/' );
if( -1 != slashPos )
fileName = fileName.mid( slashPos + 1 );
- if( fileName.isEmpty() )
+ if( fileName.isEmpty() ) {
fileName = "unnamed";
+ // Save html emails with extension
+ if ( aMsgPart->subtype() == DwMime::kSubtypeHtml )
+ fileName += ".html";
+ }
fname += "/" + fileName;
TQByteArray data = aMsgPart->bodyDecodedBinary();
@@ -1995,7 +1998,7 @@ void KMReaderWin::slotUrlOpen(const KURL &aUrl, const KParts::URLArgs &)
return;
kdWarning( 5006 ) << "KMReaderWin::slotOpenUrl(): Unhandled URL click!" << endl;
- emit urlClicked( aUrl, Qt::LeftButton );
+ emit urlClicked( aUrl, TQt::LeftButton );
}
//-----------------------------------------------------------------------------
@@ -2066,7 +2069,7 @@ void KMReaderWin::showAttachmentPopup( int id, const TQString & name, const TQPo
menu->insertItem( i18n("Scroll To"), 10 );
}
- connect(menu, TQT_SIGNAL(activated(int)), TQT_TQOBJECT(this), TQT_SLOT(slotHandleAttachment(int)));
+ connect(menu, TQ_SIGNAL(activated(int)), this, TQ_SLOT(slotHandleAttachment(int)));
menu->exec( p ,0 );
delete menu;
}
@@ -2106,8 +2109,8 @@ void KMReaderWin::slotHandleAttachment( int choice )
KMHandleAttachmentCommand* command = new KMHandleAttachmentCommand(
node, message(), mAtmCurrent, mAtmCurrentName,
KMHandleAttachmentCommand::AttachmentAction( choice ), 0, this );
- connect( command, TQT_SIGNAL( showAttachment( int, const TQString& ) ),
- TQT_TQOBJECT(this), TQT_SLOT( slotAtmView( int, const TQString& ) ) );
+ connect( command, TQ_SIGNAL( showAttachment( int, const TQString& ) ),
+ this, TQ_SLOT( slotAtmView( int, const TQString& ) ) );
command->start();
} else if ( choice == 7 ) {
slotDeleteAttachment( node );
@@ -2394,8 +2397,8 @@ void KMReaderWin::openAttachment( int id, const TQString & name )
KMHandleAttachmentCommand* command = new KMHandleAttachmentCommand( node,
message(), mAtmCurrent, mAtmCurrentName, KMHandleAttachmentCommand::Save,
offer, this );
- connect( command, TQT_SIGNAL( showAttachment( int, const TQString& ) ),
- TQT_TQOBJECT(this), TQT_SLOT( slotAtmView( int, const TQString& ) ) );
+ connect( command, TQ_SIGNAL( showAttachment( int, const TQString& ) ),
+ this, TQ_SLOT( slotAtmView( int, const TQString& ) ) );
command->start();
}
else if( choice == KMessageBox::No ) { // Open
@@ -2404,8 +2407,8 @@ void KMReaderWin::openAttachment( int id, const TQString & name )
mAtmUpdate = true;
KMHandleAttachmentCommand* command = new KMHandleAttachmentCommand( node,
message(), mAtmCurrent, mAtmCurrentName, action, offer, this );
- connect( command, TQT_SIGNAL( showAttachment( int, const TQString& ) ),
- TQT_TQOBJECT(this), TQT_SLOT( slotAtmView( int, const TQString& ) ) );
+ connect( command, TQ_SIGNAL( showAttachment( int, const TQString& ) ),
+ this, TQ_SLOT( slotAtmView( int, const TQString& ) ) );
command->start();
} else { // Cancel
kdDebug(5006) << "Canceled opening attachment" << endl;
@@ -2497,11 +2500,14 @@ void KMReaderWin::setHtmlOverride(bool override)
//-----------------------------------------------------------------------------
-void KMReaderWin::setHtmlLoadExtOverride(bool override)
+void KMReaderWin::setHtmlLoadExtDefault(bool loadExtDefault)
+{
+ mHtmlLoadExtDefault = loadExtDefault;
+}
+
+void KMReaderWin::setHtmlLoadExtOverride(bool loadExtOverride)
{
- mHtmlLoadExtOverride = override;
- //if (message())
- // message()->setDecodeHTML(htmlMail());
+ mHtmlLoadExtOverride = loadExtOverride;
}
@@ -2515,8 +2521,19 @@ bool KMReaderWin::htmlMail()
//-----------------------------------------------------------------------------
bool KMReaderWin::htmlLoadExternal()
{
- return ((mHtmlLoadExternal && !mHtmlLoadExtOverride) ||
- (!mHtmlLoadExternal && mHtmlLoadExtOverride));
+ if (!mRootNode)
+ {
+ return mHtmlLoadExtOverride;
+ }
+
+ // when displaying an encrypted message, only load external resources on explicit request
+ if (mRootNode->overallEncryptionState() != KMMsgNotEncrypted)
+ {
+ return mHtmlLoadExtOverride;
+ }
+
+ return ((mHtmlLoadExtDefault && !mHtmlLoadExtOverride) ||
+ (!mHtmlLoadExtDefault && mHtmlLoadExtOverride));
}
@@ -2673,7 +2690,7 @@ KURL KMReaderWin::tempFileUrlFromPartNode( const partNode * node )
bool ok;
int res = path.mid(left + 1, right - left - 1).toInt(&ok);
if ( res == node->nodeId() )
- return KURL( path );
+ return KURL::fromPathOrURL( path );
}
return KURL();
}
@@ -2741,14 +2758,14 @@ static TQString linkForNode( const DOM::Node &node )
bool KMReaderWin::eventFilter( TQObject *, TQEvent *e )
{
if ( e->type() == TQEvent::MouseButtonPress ) {
- TQMouseEvent* me = TQT_TQMOUSEEVENT(e);
- if ( me->button() == Qt::LeftButton && ( me->state() & ShiftButton ) ) {
+ TQMouseEvent* me = static_cast<TQMouseEvent*>(e);
+ if ( me->button() == TQt::LeftButton && ( me->state() & ShiftButton ) ) {
// special processing for shift+click
URLHandlerManager::instance()->handleShiftClick( mHoveredUrl, this );
return true;
}
- if ( me->button() == Qt::LeftButton ) {
+ if ( me->button() == TQt::LeftButton ) {
TQString imagePath;
const DOM::Node nodeUnderMouse = mViewer->nodeUnderMouse();
@@ -2773,7 +2790,7 @@ bool KMReaderWin::eventFilter( TQObject *, TQEvent *e )
}
if ( e->type() == TQEvent::MouseMove ) {
- TQMouseEvent* me = TQT_TQMOUSEEVENT( e );
+ TQMouseEvent* me = static_cast<TQMouseEvent*>( e );
// Handle this ourselves instead of connecting to mViewer::onURL(), since TDEHTML misses some
// notifications in case we started a drag ourselves
@@ -2788,8 +2805,8 @@ bool KMReaderWin::eventFilter( TQObject *, TQEvent *e )
// HACK: Send a mouse release event to the TDEHTMLView, as otherwise that will be missed in
// case we started a drag. If the event is missed, the HTML view gets into a wrong
// state, in which funny things like unsolicited drags start to happen.
- TQMouseEvent mouseEvent( TQEvent::MouseButtonRelease, me->pos(), Qt::NoButton, Qt::NoButton );
- TQT_TQOBJECT( mViewer->view() )->eventFilter( mViewer->view()->viewport(),
+ TQMouseEvent mouseEvent( TQEvent::MouseButtonRelease, me->pos(), TQt::NoButton, TQt::NoButton );
+ static_cast<TQObject*>(mViewer->view())->eventFilter( mViewer->view()->viewport(),
&mouseEvent );
return true;
}
@@ -2840,10 +2857,10 @@ void KMReaderWin::slotDeleteAttachment(partNode * node)
if ( msg && nodeId != -1 ) {
KMDeleteAttachmentCommand* command = new KMDeleteAttachmentCommand( nodeId, msg, this );
command->start();
- connect( command, TQT_SIGNAL( completed( KMCommand * ) ),
- TQT_TQOBJECT(this), TQT_SLOT( updateReaderWin() ) );
- connect( command, TQT_SIGNAL( completed( KMCommand * ) ),
- TQT_TQOBJECT(this), TQT_SLOT( disconnectMsgAdded() ) );
+ connect( command, TQ_SIGNAL( completed( KMCommand * ) ),
+ this, TQ_SLOT( updateReaderWin() ) );
+ connect( command, TQ_SIGNAL( completed( KMCommand * ) ),
+ this, TQ_SLOT( disconnectMsgAdded() ) );
// ### HACK: Since the command will do delete + add, a new message will arrive. However, we don't
// want the selection to change. Therefore, as soon as a new message arrives, select it, and then
@@ -2851,8 +2868,8 @@ void KMReaderWin::slotDeleteAttachment(partNode * node)
// Of course the are races, another message can arrive before ours, but we take the risk.
// And it won't work properly with multiple main windows
const KMHeaders * const headers = KMKernel::self()->getKMMainWidget()->headers();
- connect( headers, TQT_SIGNAL( msgAddedToListView( TQListViewItem* ) ),
- TQT_TQOBJECT(this), TQT_SLOT( msgAdded( TQListViewItem* ) ) );
+ connect( headers, TQ_SIGNAL( msgAddedToListView( TQListViewItem* ) ),
+ this, TQ_SLOT( msgAdded( TQListViewItem* ) ) );
}
// If we are operating on a copy of parts of the message, make sure to update the copy as well.
@@ -2877,8 +2894,8 @@ void KMReaderWin::msgAdded( TQListViewItem *item )
void KMReaderWin::disconnectMsgAdded()
{
const KMHeaders *const headers = KMKernel::self()->getKMMainWidget()->headers();
- disconnect( headers, TQT_SIGNAL( msgAddedToListView( TQListViewItem* ) ),
- TQT_TQOBJECT(this), TQT_SLOT( msgAdded( TQListViewItem* ) ) );
+ disconnect( headers, TQ_SIGNAL( msgAddedToListView( TQListViewItem* ) ),
+ this, TQ_SLOT( msgAdded( TQListViewItem* ) ) );
}
void KMReaderWin::slotEditAttachment(partNode * node)
@@ -3029,10 +3046,15 @@ TQString KMReaderWin::renderAttachments(partNode * node, const TQColor &bgColor
}
} else {
partNode::AttachmentDisplayInfo info = node->attachmentDisplayInfo();
+
+ // Write HTML parts and attachments to disk to allow them to be opened
+ bool writePartToDisk = info.displayInHeader || node->msgPart().subtype() == DwMime::kSubtypeHtml;
+ if ( writePartToDisk )
+ TQString fileName = writeMessagePartToTempFile( &node->msgPart(), node->nodeId() );
+
if ( info.displayInHeader ) {
html += "<div style=\"float:left;\">";
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() );
- TQString fileName = writeMessagePartToTempFile( &node->msgPart(), node->nodeId() );
TQString href = node->asHREF( "header" );
html += TQString::fromLatin1( "<a href=\"" ) + href +
TQString::fromLatin1( "\">" );