messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp
changeset 70 a15d9966050f
parent 52 12db4185673b
child 72 6f657153cbc5
--- a/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -345,29 +345,30 @@
 //---------------------------------------------------------------
 void MsgContactCardWidget::openContactInfo()
 {
+    //service stuff.
+    QString service("phonebookservices");
+    QString interface;
     QString operation;
     QList<QVariant> args;
     if (KBluetoothMsgsConversationId != ConversationsEngine::instance()->getCurrentConversationId()) {
         int contactId = resolveContactId(mContactNumber);
         if (contactId > 0) {
             //open existing contact card
-            operation = QString("open(int)");
+            interface = QString("com.nokia.symbian.IContactsView");
+            operation = QString("openContactCard(int)");
             args << contactId;
         }
         else {
             //populate data and open unknown contact template
+            interface = QString("com.nokia.symbian.IContactsEdit");
             operation = QString("editCreateNew(QString,QString)");
             QString type = QContactPhoneNumber::DefinitionName;
-
             args << type;
             args << mAddress;
         }
-        //service stuff.
-        QString serviceName("com.nokia.services.phonebookservices");
-
         XQAiwRequest* request;
         XQApplicationManager appManager;
-        request = appManager.create(serviceName, "Fetch", operation, true); // embedded
+        request = appManager.create(service, interface, operation, true); // embedded
         if (request == NULL) {
             return;
         }
@@ -379,7 +380,7 @@
 
         //disbale subscritption for the CV events
         ConversationsEngine::instance()->disableRegisterationForCVEvents();
-                
+
         request->setArguments(args);
         request->send();
         delete request;
@@ -439,8 +440,16 @@
     QList<QContact> matchingContacts = MsgContactHandler::findContactList(mContactNumber);
 
     if (!matchingContacts.isEmpty()) {
-        setAddress(matchingContacts.at(0).displayLabel());
-
+        QString displayLabel = matchingContacts.at(0).displayLabel();
+        if(!displayLabel.isEmpty())
+        {
+            setAddress(displayLabel);
+        }
+        else
+        {
+            setAddress(mContactNumber);
+        }
+        
         QList<QContactAvatar> avatarDetails = matchingContacts.at(0).details<QContactAvatar> ();
 
         if (!avatarDetails.isEmpty()) {