diff -r ecf6a73a9186 -r 60a8a215b0ec messagingapp/msgui/msgapp/src/msglistview.cpp --- a/messagingapp/msgui/msgapp/src/msglistview.cpp Tue Oct 05 13:58:47 2010 +0530 +++ b/messagingapp/msgui/msgapp/src/msglistview.cpp Tue Oct 19 11:30:16 2010 +0530 @@ -31,9 +31,10 @@ #include #include #include -#include -#include +#include +#include #include +#include #include #include @@ -50,7 +51,7 @@ //Icons const QString POPUP_LIST_FRAME("qtg_fr_popup_list_normal"); const QString NEW_MESSAGE_ICON("qtg_mono_create_message"); -const QString SORT_ICON("qtg_mono_sort"); +const QString SORT_ICON("qtg_mono_show_view"); //Localized constants @@ -59,7 +60,6 @@ //itemspecific menu #define LOC_OPEN hbTrId("txt_common_menu_open") -#define LOC_SAVETO_CONTACTS hbTrId("txt_messaging_menu_save_to_contacts") #define LOC_DELETE_CONVERSATION hbTrId("txt_messaging_menu_delete_conversation") #define LOC_OPEN_CONTACT_INFO hbTrId("txt_messaging_menu_contact_info") @@ -129,20 +129,12 @@ //save to contacts for unresolved. int msgType = viewItem->modelIndex().data(MessageType).toInt(); - if(msgType == ConvergedMessage::Sms || - msgType == ConvergedMessage::Mms || - msgType == ConvergedMessage::BioMsg) - { - qint64 contactId = mMsgList->currentIndex().data(ContactId).toLongLong(); - if(contactId < 0) - { - contextMenu->addAction(LOC_SAVETO_CONTACTS,this,SLOT(saveToContacts())); - } - else - { - contextMenu->addAction(LOC_OPEN_CONTACT_INFO,this,SLOT(contactInfo())); - } - } + if (msgType == ConvergedMessage::Sms || + msgType == ConvergedMessage::Mms || + msgType == ConvergedMessage::BioMsg) + { + contextMenu->addAction(LOC_OPEN_CONTACT_INFO, this, SLOT(contactInfo())); + } //delete conversation contextMenu->addAction(LOC_DELETE_CONVERSATION,this,SLOT(deleteItem())); @@ -365,71 +357,39 @@ } //--------------------------------------------------------------- -// MsgListView::saveToContacts -// @see header -//--------------------------------------------------------------- -void MsgListView::saveToContacts() - { - //save to contacts with phone number field prefilled. - QList args; - - QString data = mMsgList->currentIndex().data(DisplayName).toString(); - - QString type = QContactPhoneNumber::DefinitionName; - - args << type; - args << data; - - //service stuff. - QString service("phonebookservices"); - QString interface("com.nokia.symbian.IContactsEdit"); - QString operation("editCreateNew(QString,QString)"); - - XQAiwRequest* request; - XQApplicationManager appManager; - request = appManager.create(service, interface, operation, true); // embedded - if ( request == NULL ) - { - return; - } - - request->setArguments(args); - request->send(); - - delete request; - } - -//--------------------------------------------------------------- // MsgListView::contactInfo // @see header //--------------------------------------------------------------- void MsgListView::contactInfo() - { - //open contact info. - QList args; +{ + QList args; + XQAiwRequest* request = NULL; + XQApplicationManager appManager; int contactId = mMsgList->currentIndex().data(ContactId).toInt(); - args << contactId; - - //service stuff. - QString service("phonebookservices"); - QString interface("com.nokia.symbian.IContactsView"); - QString operation("openContactCard(int)"); + if (contactId < 0) { + // open temp contact card + request = appManager.create(XQI_CONTACTS_VIEW, + XQOP_CONTACTS_VIEW_TEMP_CONTACT_CARD_WITH_DETAIL, true); // Embedded + args << QContactPhoneNumber::DefinitionName; // Type + args << mMsgList->currentIndex().data(DisplayName).toString(); // Actual data + } + else { + // open existing contact card + request = appManager.create(XQI_CONTACTS_VIEW, XQOP_CONTACTS_VIEW_CONTACT_CARD, true); // Embedded + args << contactId; + } - XQAiwRequest* request; - XQApplicationManager appManager; - request = appManager.create(service, interface, operation, true); // embedded - if ( request == NULL ) - { - return; - } + if (request == NULL) { + return; + } request->setArguments(args); request->send(); - + delete request; - } +} //--------------------------------------------------------------- // MsgListView::onDialogDeleteMsg