diff options
author | Janne Anttila <janne.anttila@digia.com> | 2009-06-10 08:54:36 (GMT) |
---|---|---|
committer | Janne Anttila <janne.anttila@digia.com> | 2009-06-10 08:54:36 (GMT) |
commit | de32770849417fbca964f52eb4d16e7913b28ea1 (patch) | |
tree | 6b60372072cf89a4ef2f769fae5e7aba04805ea5 /src/gui/util | |
parent | 5d43a51bb53718b9c98b1720ed46469e5b77fa6f (diff) | |
download | Qt-de32770849417fbca964f52eb4d16e7913b28ea1.zip Qt-de32770849417fbca964f52eb4d16e7913b28ea1.tar.gz Qt-de32770849417fbca964f52eb4d16e7913b28ea1.tar.bz2 |
Switched QDesktopServices mail-to URL handling to RSendAs in Symbian.
Earlier used CSendUi required extensiva capabilities to work correctly,
that's why "new email" option in desktop services example application
did not work correctly with self signed capabilities.
RSendAs requires lower capabilities since SendAs server (separate
process) takes care of necessary actions to send the message.
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qdesktopservices_s60.cpp | 54 | ||||
-rw-r--r-- | src/gui/util/util.pri | 5 |
2 files changed, 23 insertions, 36 deletions
diff --git a/src/gui/util/qdesktopservices_s60.cpp b/src/gui/util/qdesktopservices_s60.cpp index a30e2ed..d53c046 100644 --- a/src/gui/util/qdesktopservices_s60.cpp +++ b/src/gui/util/qdesktopservices_s60.cpp @@ -54,8 +54,8 @@ #include <eikenv.h> // CEikonEnv #include <apgcli.h> // RApaLsSession #include <apgtask.h> // TApaTaskList, TApaTask -#include <sendui.h> // CSendUi -#include <cmessagedata.h> // CMessageData +#include <rsendas.h> // RSendAs +#include <rsendasmessage.h> // RSendAsMessage #include <pathinfo.h> // PathInfo #ifdef USE_DOCUMENTHANDLER #include <documenthandler.h> // CDocumentHandler @@ -85,52 +85,44 @@ static void handleMailtoSchemeL(const QUrl &url) QStringList bccs = bcc.split(","); - CSendUi* sendUi = CSendUi::NewLC(); + RSendAs sendAs; + User::LeaveIfError(sendAs.Connect()); + CleanupClosePushL(sendAs); + + RSendAsMessage sendAsMessage; + sendAsMessage.CreateL(sendAs, KUidMsgTypeSMTP); + CleanupClosePushL(sendAsMessage); - // Construct symbian sendUI data holder - CMessageData* messageData = CMessageData::NewLC(); // Subject - TPtrC subj( qt_QString2TPtrC(subject) ); - messageData->SetSubjectL( &subj ); + sendAsMessage.SetSubjectL(qt_QString2TPtrC(subject)); // Body - CParaFormatLayer* paraFormat = CParaFormatLayer::NewL(); - CleanupStack::PushL( paraFormat ); - CCharFormatLayer* charFormat = CCharFormatLayer::NewL(); - CleanupStack::PushL( charFormat ); - CRichText* bodyRichText = CRichText::NewL( paraFormat, charFormat ); - CleanupStack::PushL( bodyRichText ); - - TPtrC bodyPtr( qt_QString2TPtrC(body) ); - if( bodyPtr.Length() ) - { - bodyRichText->InsertL( 0, bodyPtr ); - } - else - { - bodyRichText->InsertL( 0, KNullDesC ); - } - - messageData->SetBodyTextL( bodyRichText ); + sendAsMessage.SetBodyTextL(qt_QString2TPtrC(body)); // To foreach(QString item, recipients) - messageData->AppendToAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); foreach(QString item, tos) - messageData->AppendToAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientTo ); // Cc foreach(QString item, ccs) - messageData->AppendCcAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientCc ); // Bcc foreach(QString item, bccs) - messageData->AppendBccAddressL(qt_QString2TPtrC(item)); + sendAsMessage.AddRecipientL(qt_QString2TPtrC(item), RSendAsMessage::ESendAsRecipientBcc ); + + // send the message + sendAsMessage.LaunchEditorAndCloseL(); + + // sendAsMessage (already closed) + CleanupStack::Pop(); - sendUi->CreateAndSendMessageL( KUidMsgTypeSMTP, messageData ); - CleanupStack::PopAndDestroy( 5 ); // bodyRichText, charFormat, paraFormat, messageData, sendUi + // sendAs + CleanupStack::PopAndDestroy(); } static bool handleMailtoScheme(const QUrl &url) diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri index 69c53ae..e628229 100644 --- a/src/gui/util/util.pri +++ b/src/gui/util/util.pri @@ -35,11 +35,6 @@ embedded { util/qsystemtrayicon_qws.cpp } -symbian { - # QDesktopServices uses CSendUi which is located on app layer - INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE -} - !embedded:!x11:mac { OBJECTIVE_SOURCES += util/qsystemtrayicon_mac.mm } |