author | ulf69 <ulf69> | 2004-08-10 22:40:58 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-10 22:40:58 (UTC) |
commit | c1ef5e08dbc5d0b891de75ef8e90e73cc4f3d26f (patch) (side-by-side diff) | |
tree | d225831e4aa2af66480dbb7df3a9e56590c8ddbb | |
parent | 29abd716e5187a4717a5459b9c25c6c299df8d56 (diff) | |
download | kdepimpi-c1ef5e08dbc5d0b891de75ef8e90e73cc4f3d26f.zip kdepimpi-c1ef5e08dbc5d0b891de75ef8e90e73cc4f3d26f.tar.gz kdepimpi-c1ef5e08dbc5d0b891de75ef8e90e73cc4f3d26f.tar.bz2 |
changes on how we call external email application
-rw-r--r-- | libkdepim/externalapphandler.cpp | 70 |
1 files changed, 48 insertions, 22 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp index 5a56d68..1093abf 100644 --- a/libkdepim/externalapphandler.cpp +++ b/libkdepim/externalapphandler.cpp @@ -95,9 +95,9 @@ void ExternalAppHandler::loadConfig() ( QFile::exists( opiepath + "/bin/ompi" ))) - addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", "newMail(QString)", "%1", mailmsg2, "ATTACHMENT=%1"); + addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OMPI_EMC, "OM/Pi email client", "QPE/Application/ompi", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); if ( QFile::exists( qtopiapath + "/bin/qtmail" )) - addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, ";%1", mailmsg2, "ATTACHMENT=%1"); + addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::QTOPIA_EMC, "Qtopia email client", "QPE/Application/qtmail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); if ( QFile::exists( opiepath + "/bin/opiemail" )) - addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, ";%1", mailmsg2, "ATTACHMENT=%1"); + addDefaultAppItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::OPIE_EMC, "Opie email client", "QPE/Application/opiemail", mailmsg1, "%1;%2", mailmsg2, "TO=%1;ATTACHMENT=%2"); @@ -269,3 +269,3 @@ bool ExternalAppHandler::isPagerAppAvailable() //calls the emailapplication with a number of attachments that need to be send (Seperated by Comma) -bool ExternalAppHandler::mailAttachments( const QString& urls ) +bool ExternalAppHandler::mailToMultipleContacts( const QString& emails, const QString& urls ) { @@ -298,5 +298,8 @@ bool ExternalAppHandler::mailAttachments( const QString& urls ) + //first check if one of the mailers need the emails right in the message. + message2 = translateMessage(message2, emails, urls); + qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message2.latin1()); - qDebug("passing attachmenturls:(%s) as parameter in the form %s to QCopEnvelope", urls.latin1(), parameters2.latin1()); + qDebug("passing emailadresses:(%s), attachmenturls:(%s) as parameters in the form %s to QCopEnvelope", emails.latin1() , urls.latin1(), parameters2.latin1()); @@ -306,3 +309,3 @@ bool ExternalAppHandler::mailAttachments( const QString& urls ) - passParameter(&e, parameters2, urls); + passParameters(&e, parameters2, emails, urls); @@ -323,3 +326,3 @@ bool ExternalAppHandler::mailAttachments( const QString& urls ) //calls the emailapplication and creates a mail with parameter emails as recipients -bool ExternalAppHandler::mailToContacts( const QString& emails ) +bool ExternalAppHandler::mailToOneContact( const QString& name, const QString& emailadress ) { @@ -353,3 +356,3 @@ bool ExternalAppHandler::mailToContacts( const QString& emails ) //first check if one of the mailers need the emails right in the message. - message = translateMessage(message, emails); + message = translateMessage(message, name, emailadress); @@ -357,3 +360,3 @@ bool ExternalAppHandler::mailToContacts( const QString& emails ) qDebug("Using QCopEnvelope e(\"%s\",\"%s\")", channel.latin1(), message.latin1()); - qDebug("passing emailadresses:(%s) as parameter in the form %s to QCopEnvelope", emails.latin1(), parameters.latin1()); + qDebug("passing name:(%s), emailadresses:(%s) as parameters in the form %s to QCopEnvelope", name.latin1(), emailadress.latin1(), parameters.latin1()); @@ -362,3 +365,3 @@ bool ExternalAppHandler::mailToContacts( const QString& emails ) - passParameter(&e, parameters, emails); + passParameters(&e, parameters, name, emailadress); @@ -377,2 +380,23 @@ bool ExternalAppHandler::mailToContacts( const QString& emails ) +//calls the emailapplication and creates a mail with parameter as recipients +// parameters format is +// NAME <EMAIL>:SUBJECT +bool ExternalAppHandler::mailToOneContact( const QString& adressline ) +{ + QString line = adressline; + + int first = line.find( "<"); + int last = line.find( ">"); + QString name = line.left(first); + QString emailadress = line.mid(first+1, last-first-1); + + //Subject can not be handled right now. + mailToOneContact( name, emailadress ); +} + + +/************************************************************************** + * + **************************************************************************/ + //calls the phoneapplication with the number @@ -408,3 +432,3 @@ bool ExternalAppHandler::callByPhone( const QString& phonenumber ) //first check if one of the mailers need the emails right in the message. - message = translateMessage(message, phonenumber); + message = translateMessage(message, phonenumber, ""); @@ -417,3 +441,3 @@ bool ExternalAppHandler::callByPhone( const QString& phonenumber ) - passParameter(&e, parameters, phonenumber); + passParameters(&e, parameters, phonenumber, ""); @@ -463,3 +487,3 @@ bool ExternalAppHandler::callBySMS( const QString& phonenumber ) //first check if one of the mailers need the emails right in the message. - message = translateMessage(message, phonenumber); + message = translateMessage(message, phonenumber, ""); @@ -472,3 +496,3 @@ bool ExternalAppHandler::callBySMS( const QString& phonenumber ) - passParameter(&e, parameters, phonenumber); + passParameters(&e, parameters, phonenumber, ""); @@ -518,3 +542,3 @@ bool ExternalAppHandler::callByPager( const QString& pagernumber ) //first check if one of the mailers need the emails right in the message. - message = translateMessage(message, pagernumber); + message = translateMessage(message, pagernumber, ""); @@ -527,3 +551,3 @@ bool ExternalAppHandler::callByPager( const QString& pagernumber ) - passParameter(&e, parameters, pagernumber); + passParameters(&e, parameters, pagernumber, ""); @@ -573,3 +597,3 @@ bool ExternalAppHandler::callByFax( const QString& faxnumber ) //first check if one of the mailers need the emails right in the message. - message = translateMessage(message, faxnumber); + message = translateMessage(message, faxnumber, ""); @@ -582,3 +606,3 @@ bool ExternalAppHandler::callByFax( const QString& faxnumber ) - passParameter(&e, parameters, faxnumber); + passParameters(&e, parameters, faxnumber, ""); @@ -598,6 +622,6 @@ bool ExternalAppHandler::callByFax( const QString& faxnumber ) - -QString& ExternalAppHandler::translateMessage(QString& message, const QString& param1) const +QString& ExternalAppHandler::translateMessage(QString& message, const QString& param1, const QString& param2 ) const { - return message.replace( QRegExp("%1"), param1 ); + message = message.replace( QRegExp("%1"), param1 ); + return message.replace( QRegExp("%2"), param2 ); } @@ -608,3 +632,3 @@ QString& ExternalAppHandler::translateMessage(QString& message, const QString& p -void ExternalAppHandler::passParameter(QCopEnvelope* e, const QString& parameters, const QString& param1) const +void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& parameters, const QString& param1 , const QString& param2) const { @@ -629,2 +653,3 @@ void ExternalAppHandler::passParameter(QCopEnvelope* e, const QString& parameter key = key.replace( QRegExp("%1"), param1 ); + key = key.replace( QRegExp("%2"), param2 ); ++it2; @@ -635,2 +660,3 @@ void ExternalAppHandler::passParameter(QCopEnvelope* e, const QString& parameter value = value.replace( QRegExp("%1"), param1 ); + value = value.replace( QRegExp("%2"), param2 ); |