messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp
changeset 51 3507212d340e
parent 41 25fe1fe642e3
child 56 f42d9a78f435
--- a/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp	Tue Aug 03 21:34:40 2010 +0530
+++ b/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp	Fri Aug 06 23:19:50 2010 +0530
@@ -62,7 +62,7 @@
 // @see header
 //---------------------------------------------------------------
 MsgContactCardWidget::MsgContactCardWidget(QGraphicsItem *parent) :
-    HbWidget(parent), mIgnoreEvents(false), mAvatarIconItem(NULL), mPresenceIconItem(NULL),
+    HbWidget(parent), mAvatarIconItem(NULL), mPresenceIconItem(NULL),
         mAddressTextItem(NULL), mThumbnailManager(NULL)
 {
     init();
@@ -295,11 +295,6 @@
 //---------------------------------------------------------------
 void MsgContactCardWidget::handleLongTap(const QPointF &position)
 {
-    // Check if events need to be ignored/accepted
-    if (mIgnoreEvents) {
-        return;
-    }
-
     if (KBluetoothMsgsConversationId != ConversationsEngine::instance()->getCurrentConversationId()) {
         HbMenu* contextMenu = new HbMenu();
         contextMenu->setDismissPolicy(HbPopup::TapAnywhere);
@@ -328,11 +323,6 @@
 {
     this->ungrabGesture(Qt::TapGesture);
     
-    // Check if events need to be ignored/accepted
-    if (mIgnoreEvents) {
-        return;
-    }
-    
     int contactId = resolveContactId(mContactNumber);
     if(contactId > 0)
     {
@@ -456,7 +446,18 @@
         if (!avatarDetails.isEmpty()) {
             mThumbnailManager->getThumbnail(avatarDetails.at(0).imageUrl().toString());
         }
+        else {
+            //Set default avatar since avtar is deleted        
+            setAvatar(HbIcon(DEFAULT_AVATAR_ICON));
+        }        
 	}
+    else  {
+        //case for deletion from contact card widget
+        //set the default number as address
+        setAddress(mContactNumber);
+        //Set default avatar since contact is deleted
+        setAvatar(HbIcon(DEFAULT_AVATAR_ICON));
+    }
 	
 	// Get the new conversation id.
     qint64 convId = ConversationsEngine::instance()->getConversationIdFromAddress(
@@ -517,15 +518,6 @@
 }
 
 //---------------------------------------------------------------
-// MsgContactCardWidget::ignoreSignals
-// @see header
-//---------------------------------------------------------------
-void MsgContactCardWidget::ignoreSignals(bool yes)
-{
-    mIgnoreEvents = yes;
-}
-
-//---------------------------------------------------------------
 // MsgContactCardWidget::regrabGesture
 // @see header file
 //---------------------------------------------------------------