Make the New Message action from KMail's Kontact plugin respect the folder identity. This made the creation of a new hidden DCOP call necessary.

svn path=/trunk/kdepim/; revision=344172
wilder-work
Ingo Klcker 22 years ago
parent 87518f77fc
commit d1cba8912c
  1. 3
      kmailIface.h
  2. 22
      kmkernel.cpp
  3. 3
      kmkernel.h

@ -111,6 +111,9 @@ k_dcop_signals:
void unreadCountChanged( const QString& folderURL, int numUnread );
k_dcop_hidden:
/** DCOP call which is used by the Kontact plugin to create a new message. */
virtual DCOPRef newMessage() = 0;
virtual bool showMail( Q_UINT32 serialNumber, QString messageId ) = 0;
/**
* DCOP-enabled for KMailUniqueAppHandler in the kontact plugin

@ -508,6 +508,28 @@ DCOPRef KMKernel::openComposer(const QString &to, const QString &cc,
return DCOPRef(cWin);
}
DCOPRef KMKernel::newMessage()
{
KMFolder *folder = 0;
KMMainWidget *widget = getKMMainWidget();
if ( widget && widget->folderTree() )
folder = widget->folderTree()->currentFolder();
// the following code is basically the same as in KMMainWidget::slotCompose()
KMComposeWin *win;
KMMessage *msg = new KMMessage;
if ( folder ) {
msg->initHeader( folder->identity() );
win = new KMComposeWin( msg, folder->identity() );
} else {
msg->initHeader();
win = new KMComposeWin( msg );
}
win->show();
return DCOPRef( win );
}
int KMKernel::viewMessage( const KURL & messageFile )
{
KMOpenMsgCommand *openCommand = new KMOpenMsgCommand( 0, messageFile );

@ -125,6 +125,9 @@ public:
const QString &bcc, const QString &subject,
const QString &body,bool hidden);
/** DCOP call used by the Kontact plugin to create a new message. */
DCOPRef newMessage();
int sendCertificate( const QString& to, const QByteArray& certData );
void openReader() { openReader( false ); }

Loading…
Cancel
Save