phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp
changeset 66 554fe4dbbb59
parent 50 77bc263e1626
--- a/phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp	Mon Aug 23 16:06:28 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cnthistoryviewitem.cpp	Fri Sep 03 14:32:33 2010 +0300
@@ -16,6 +16,7 @@
  */
 
 #include "cnthistoryviewitem.h"
+#include "cntdebug.h"
 
 #include <cnthistorymodel.h>
 #include <hbframedrawer.h>
@@ -37,6 +38,9 @@
   mNewItem(NULL),
   mFocusItem(NULL)
 {
+    CNT_ENTRY
+    
+    CNT_EXIT
 }
 
 //---------------------------------------------------------------
@@ -54,9 +58,13 @@
 //---------------------------------------------------------------
 void CntHistoryViewItem::updateChildItems()
 {
+    CNT_ENTRY
+    
     int flags = modelIndex().data(CntFlagsRole).toInt();
     mIncoming = flags & CntIncoming ? true : false;
     mNewMessage = flags & CntUnseen ? true : false;
+    
+    CNT_LOG_ARGS(mIncoming << mNewMessage)
 
     if (mNewMessage)
     {
@@ -76,6 +84,10 @@
     }
     
     HbListViewItem::updateChildItems();
+    
+    repolish();
+    
+    CNT_EXIT
 }
 
 //---------------------------------------------------------------
@@ -84,6 +96,8 @@
 //---------------------------------------------------------------
 void CntHistoryViewItem::pressStateChanged(bool pressed, bool animate)
 {
+    CNT_ENTRY
+    
     Q_UNUSED(animate);
     if (pressed)
     {
@@ -117,27 +131,8 @@
             mFocusItem = NULL;
         }
     }
-}
-
-bool CntHistoryViewItem::event(QEvent* e)
-{
-    bool result;
-    if (e->type() == QEvent::GraphicsSceneResize)
-    {
-        // HbAbstractItemView has a performance improvement when drawing backrounds but seems
-        // to screw the layout of history view items. This workaround fixes the issue. There should
-        // be minimal performance drawbacks since GraphicsSceneResize events are quite few.
-        // TODO: Remove this once Orbit changes their implementation. Not known when
-        QGraphicsWidget *frame = static_cast<QGraphicsWidget*>(primitive("frame"));
-        QRectF frameGeometry = frame->geometry();
-        result = HbListViewItem::event(e);
-        frame->setGeometry(frameGeometry);
-    } 
-    else
-    {
-        result = HbListViewItem::event(e);
-    }
-    return result;
+    
+    CNT_EXIT
 }
 
 // EOF