--- a/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp Tue Jul 06 14:12:40 2010 +0300
+++ b/messagingapp/msgui/conversationview/src/msgcontactcardwidget.cpp Wed Aug 18 09:45:25 2010 +0300
@@ -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();
@@ -144,15 +144,17 @@
QStandardItemModel* msgModel = ConversationsEngine::instance()->getConversationsModel();
const int rowCnt = msgModel->rowCount();
QModelIndex index = msgModel->index(rowCnt-1, 0);
- ConvergedMessageAddress* address = new ConvergedMessageAddress(
- index.data(ConversationAddress).toString());
+ QString addr = index.data(ConversationAddress).toString();
+ ConvergedMessageAddress* address = new ConvergedMessageAddress(addr);
+ // resolve contact
QString displayname;
- QString addr;
- ConversationsEngine::instance()->getContactDetails(
- ConversationsEngine::instance()->getCurrentConversationId(),
- displayname,
- addr);
- address->setAlias(displayname);
+ int count;
+ int retval = MsgContactHandler::resolveContactDisplayName(
+ addr, displayname, count);
+ if(retval != -1)
+ {
+ address->setAlias(displayname);
+ }
addresses.append(address);
return addresses;
}
@@ -293,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);
@@ -326,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)
{
@@ -454,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(
@@ -515,15 +518,6 @@
}
//---------------------------------------------------------------
-// MsgContactCardWidget::ignoreSignals
-// @see header
-//---------------------------------------------------------------
-void MsgContactCardWidget::ignoreSignals(bool yes)
-{
- mIgnoreEvents = yes;
-}
-
-//---------------------------------------------------------------
// MsgContactCardWidget::regrabGesture
// @see header file
//---------------------------------------------------------------