Merged revisions 851216 via svnmerge from

svn+ssh://tmcguire@svn.kde.org/home/kde/branches/KDE/4.1/kdepim

........
  r851216 | tmcguire | 2008-08-23 12:12:29 +0200 (Sat, 23 Aug 2008) | 12 lines
  
  Backport r847987 by tmcguire from trunk to the 4.1 branch:
  
  Don't duplicate attachment handling code in the mime part tree.
  This fixes crashes when viewing loaded-on-demand attachments via the mime tree,
  since it would not set mAtmUpdate correctly, which prevents re-creating the part
  tree when the part is retrived. Re-creating the part-tree would make the pointers
  inside the map of the load parts command invalid and therefore trigger a crash.
  
  CCBUG: 136145
........

svn path=/branches/kdepim/enterprise4/kdepim/; revision=851355
wilder-work
Thomas McGuire 18 years ago
parent 01f8943c81
commit 9998d5e9c9
  1. 10
      kmmimeparttree.cpp
  2. 12
      kmreaderwin.cpp
  3. 20
      kmreaderwin.h

@ -298,16 +298,10 @@ void KMMimePartTree::startHandleAttachmentCommand( int action )
return;
partNode *node = static_cast<KMMimePartTreeItem *>( selected.first() )->node();
QString name = mReaderWin->tempFileUrlFromPartNode( node ).path();
KMHandleAttachmentCommand *command = new KMHandleAttachmentCommand(
node, mReaderWin->message(), node->nodeId(), name,
KMHandleAttachmentCommand::AttachmentAction( action ),
KService::Ptr(), this );
connect( command, SIGNAL( showAttachment( int, const QString& ) ),
mReaderWin, SLOT( slotAtmView( int, const QString& ) ) );
command->start();
mReaderWin->prepareHandleAttachment( node->nodeId(), name );
mReaderWin->slotHandleAttachment( action );
}
void KMMimePartTree::slotCopy()

@ -1960,10 +1960,16 @@ void KMReaderWin::slotUrlPopup(const QString &aUrl, const QPoint& aPos)
}
//-----------------------------------------------------------------------------
void KMReaderWin::showAttachmentPopup( int id, const QString & name, const QPoint &p )
void KMReaderWin::prepareHandleAttachment( int id, const QString& fileName )
{
mAtmCurrent = id;
mAtmCurrentName = name;
mAtmCurrentName = fileName;
}
//-----------------------------------------------------------------------------
void KMReaderWin::showAttachmentPopup( int id, const QString & name, const QPoint &p )
{
prepareHandleAttachment( id, name );
KMenu *menu = new KMenu();
QAction *action;
@ -2663,7 +2669,7 @@ void KMReaderWin::slotEditAttachment(partNode * node)
command->start();
}
KMail::CSSHelper* KMReaderWin::cssHelper()
KMail::CSSHelper* KMReaderWin::cssHelper() const
{
return mCSSHelper;
}

@ -282,6 +282,13 @@ public:
emit popupMenu( *message(), url, p );
}
/**
* Sets the current attachment ID and the current attachment temporary filename
* to the given values.
* Call this so that slotHandleAttachment() knows which attachment to handle.
*/
void prepareHandleAttachment( int id, const QString& fileName );
void showAttachmentPopup( int id, const QString & name, const QPoint & p );
/** Set the serial number of the message this reader window is currently
@ -308,6 +315,8 @@ public:
/* show or hide the list that points to the attachments */
void setShowAttachmentQuicklist( bool showAttachmentQuicklist = true ) { mShowAttachmentQuicklist = showAttachmentQuicklist; }
KMail::CSSHelper* cssHelper() const;
signals:
/** Emitted after parsing of a message to have it stored
in unencrypted state in it's folder. */
@ -386,7 +395,15 @@ public slots:
void slotDeleteAttachment( partNode* node );
void slotEditAttachment( partNode* node );
KMail::CSSHelper* cssHelper();
/**
* Does an action for the current attachment.
* The action is defined by the KMHandleAttachmentCommand::AttachmentAction
* enum.
* prepareHandleAttachment() needs to be called before calling this to set the
* correct attachment ID.
*/
void slotHandleAttachment( int action );
protected slots:
void slotCycleHeaderStyles();
@ -406,7 +423,6 @@ protected slots:
/** Some attachment operations. */
void slotAtmView( int id, const QString& name );
void slotDelayedResize();
void slotHandleAttachment( int );
/** Print message. Called on as a response of finished() signal of mPartHtmlWriter
after rendering is finished.

Loading…
Cancel
Save