Fetch the full item when activating (double clicking)

svn path=/branches/work/akonadi-ports/kdepim/; revision=1047578
wilder-work
Stephen Kelly 17 years ago
parent 7fd28abc10
commit a693159f6e
  1. 34
      kmmainwidget.cpp
  2. 1
      kmmainwidget.h

@ -2882,6 +2882,31 @@ void KMMainWidget::slotMessageActivated( const Akonadi::Item &msg )
{
if ( !mCurrentFolder || !msg.isValid() )
return;
if ( kmkernel->folderIsDraftOrOutbox( mCurrentFolder->collection() ) )
{
mMsgActions->editCurrentMessage();
return;
}
if ( kmkernel->folderIsTemplates( mCurrentFolder->collection() ) ) {
slotUseTemplate();
return;
}
// TODO: Port to partFetcher so that this is not necessary.
ItemFetchJob *itemFetchJob = new ItemFetchJob( msg, this );
itemFetchJob->fetchScope().fetchFullPayload( true );
connect( itemFetchJob, SIGNAL(itemsReceived(Akonadi::Item::List)), SLOT(slotItemsFetchedForActivation(Akonadi::Item::List)) );
connect( itemFetchJob, SIGNAL(result(KJob *)), SLOT(itemsFetchDone(KJob*)) );
}
void KMMainWidget::slotItemsFetchedForActivation( const Akonadi::Item::List &list )
{
Q_ASSERT( list.size() == 1 );
Item msg = list.first();
#if 0//Laurent port it
if (msg->parent() && !msg->isComplete())
{
@ -2895,15 +2920,6 @@ void KMMainWidget::slotMessageActivated( const Akonadi::Item &msg )
#else
kDebug() << "AKONADI PORT: Disabled code in " << Q_FUNC_INFO;
#endif
if (kmkernel->folderIsDraftOrOutbox(mCurrentFolder->collection()))
{
mMsgActions->editCurrentMessage();
return;
}
if ( kmkernel->folderIsTemplates( mCurrentFolder->collection() ) ) {
slotUseTemplate();
return;
}
KMReaderMainWin *win = new KMReaderMainWin( mFolderHtmlPref, mFolderHtmlLoadExtPref );
KConfigGroup reader( KMKernel::config(), "Reader" );

@ -216,6 +216,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget
Open a separate viewer window containing the specified message.
*/
void slotMessageActivated( const Akonadi::Item & );
void slotItemsFetchedForActivation( const Akonadi::Item::List &list );
void slotMessageStatusChangeRequest( const Akonadi::Item &, const KPIM::MessageStatus &, const KPIM::MessageStatus & );

Loading…
Cancel
Save