From 0fb5214ec1a5dca60aa2253cac6b83a88ec8a206 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Wed, 17 Sep 2008 18:42:27 +0000 Subject: [PATCH] Extend the openComposer() DCOP method by an identity parameter and use that in KOrganizer to send invitations from the identity that was used as organizer instead of the default identity. Kolab issue 2830 svn path=/branches/kdepim/enterprise/kdepim/; revision=861999 --- kmailIface.h | 15 ++++++++++++++- kmkernel.cpp | 22 ++++++++++++++++++++++ kmkernel.h | 17 +++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/kmailIface.h b/kmailIface.h index 1a4a04f23..fd76d1af2 100644 --- a/kmailIface.h +++ b/kmailIface.h @@ -60,6 +60,19 @@ k_dcop: const QString &attachParamValue, const QCString &attachContDisp, const QCString &attachCharset) = 0; + virtual int openComposer (const QString &to, const QString &cc, + const QString &bcc, const QString &subject, + const QString &body, int hidden, + const QString &attachName, + const QCString &attachCte, + const QCString &attachData, + const QCString &attachType, + const QCString &attachSubType, + const QCString &attachParamAttr, + const QString &attachParamValue, + const QCString &attachContDisp, + const QCString &attachCharset, + uint identity) = 0; /** Open composer and return reference to DCOP interface of composer window. If hidden is true, the window will not be shown. If you use that option, it's your responsibility to call the send() function of the composer in @@ -211,7 +224,7 @@ k_dcop_hidden: /** Clears the list of added message ids which is used to filter out duplicates. */ virtual void dcopResetAddMessage() = 0; - + virtual void loadProfile( const QString& path ) = 0; virtual void saveToProfile( const QString& path ) const = 0; }; diff --git a/kmkernel.cpp b/kmkernel.cpp index 0a181cb92..d3e56d2db 100644 --- a/kmkernel.cpp +++ b/kmkernel.cpp @@ -484,6 +484,27 @@ int KMKernel::openComposer (const QString &to, const QString &cc, const QString &attachParamValue, const QCString &attachContDisp, const QCString &attachCharset ) +{ + kdDebug(5006) << "KMKernel::openComposer called (deprecated version)" << endl; + return openComposer ( to, cc, bcc, subject, body, hidden, + attachName, attachCte, attachData, + attachType, attachSubType, attachParamAttr, + attachParamValue, attachContDisp, attachCharset, 0 ); +} + +int KMKernel::openComposer (const QString &to, const QString &cc, + const QString &bcc, const QString &subject, + const QString &body, int hidden, + const QString &attachName, + const QCString &attachCte, + const QCString &attachData, + const QCString &attachType, + const QCString &attachSubType, + const QCString &attachParamAttr, + const QString &attachParamValue, + const QCString &attachContDisp, + const QCString &attachCharset, + unsigned int identity ) { kdDebug(5006) << "KMKernel::openComposer()" << endl; @@ -495,6 +516,7 @@ int KMKernel::openComposer (const QString &to, const QString &cc, if ( !bcc.isEmpty() ) msg->setBcc(bcc); if ( !subject.isEmpty() ) msg->setSubject(subject); if ( !to.isEmpty() ) msg->setTo(to); + if ( identity > 0 ) msg->setHeaderField( "X-KMail-Identity", QString::number( identity ) ); if ( !body.isEmpty() ) { msg->setBody(body.utf8()); } else { diff --git a/kmkernel.h b/kmkernel.h index cd30a6e26..08b6ea160 100644 --- a/kmkernel.h +++ b/kmkernel.h @@ -135,6 +135,9 @@ public: const QString &attachParamValue, const QCString &attachContDisp); + /** For backward compatibility + * @deprecated + */ int openComposer (const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body, int hidden, @@ -148,6 +151,20 @@ public: const QCString &attachContDisp, const QCString &attachCharset); + int openComposer (const QString &to, const QString &cc, + const QString &bcc, const QString &subject, + const QString &body, int hidden, + const QString &attachName, + const QCString &attachCte, + const QCString &attachData, + const QCString &attachType, + const QCString &attachSubType, + const QCString &attachParamAttr, + const QString &attachParamValue, + const QCString &attachContDisp, + const QCString &attachCharset, + unsigned int identity); + DCOPRef openComposer(const QString &to, const QString &cc, const QString &bcc, const QString &subject, const QString &body,bool hidden);