diff -r 2f8f8080a020 -r ebdbd102c78a phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.cpp --- a/phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.cpp Mon May 03 12:31:11 2010 +0300 +++ b/phoneuis/bubblemanager2/bubblecore/src/bubbleconferencehandler.cpp Fri May 14 15:51:57 2010 +0300 @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -27,9 +26,9 @@ #include "bubbleconferencehandler.h" #include "bubbleconferenceheader.h" #include "bubbleutils.h" -#include "bubblebuttonstyle.h" #include "bubbleparticipantlistitem.h" #include "bubbleparticipantlistmodel.h" +#include "bubblebutton.h" static const int BUBBLE_SELECTION_TIMEOUT = 3000; @@ -50,13 +49,13 @@ mTimerLabel->setAlignment(Qt::AlignLeft); mButtonCenter = - qobject_cast(widget(BubbleWidgetManager::CenterButton)); + qobject_cast(widget(BubbleWidgetManager::CenterButton)); Q_ASSERT(mButtonCenter); mButtonLeft = - qobject_cast(widget(BubbleWidgetManager::LeftButton)); + qobject_cast(widget(BubbleWidgetManager::LeftButton)); Q_ASSERT(mButtonLeft); mButtonRight = - qobject_cast(widget(BubbleWidgetManager::RightButton)); + qobject_cast(widget(BubbleWidgetManager::RightButton)); Q_ASSERT(mButtonRight); mList = @@ -70,8 +69,10 @@ widgetManager.createParticipantListItem()); Q_ASSERT(mPrototype); mList->setItemPrototype(mPrototype); - connect(mPrototype,SIGNAL(selectionChanged(int)), - SLOT(handleItemSelected(int))); + connect(mList->selectionModel(), + SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, + SLOT(handleItemSelected(QModelIndex,QModelIndex))); mSelectionTimer = new QTimer(this); connect(mSelectionTimer,SIGNAL(timeout()),SLOT(clearSelection())); @@ -107,6 +108,13 @@ Q_ASSERT(header.isConference()); mHeader = static_cast(&header); + // set actions to item prototype + QList prototypes = mList->itemPrototypes(); + QList actions = mHeader->participantListActions(); + foreach (HbAction* action, actions ) { + mPrototype->addAction(action); + } + // populate participant list model QList participants = mHeader->headers(); foreach(BubbleHeader* participant, participants) { @@ -117,13 +125,6 @@ !(mHeader->callFlags()&BubbleManagerIF::NoCiphering)); } - // set actions to item prototype - QList prototypes = mList->itemPrototypes(); - QList actions = mHeader->participantListActions(); - foreach (HbAction* action, actions ) { - mPrototype->addAction(action); - } - if (header.timerCost().length()) { QColor color; color = HbColorScheme::color("list_item_title_normal"); @@ -188,15 +189,21 @@ mTimerLabel->update(); } -void BubbleConferenceHandler::handleItemSelected(int row) +void BubbleConferenceHandler::handleItemSelected( + const QModelIndex & current, + const QModelIndex & previous ) { - Q_ASSERT( mHeader != 0 ); - // need to cast constness away - BubbleConferenceHeader& mutableHeader = - const_cast(*mHeader); - mutableHeader.setSelectedHeader(mModel->bubbleId(row)); - mSelectionTimer->stop(); - mSelectionTimer->start(BUBBLE_SELECTION_TIMEOUT); + Q_UNUSED(previous); + + if (current.isValid()) { + Q_ASSERT( mHeader != 0 ); + // need to cast constness away + BubbleConferenceHeader& mutableHeader = + const_cast(*mHeader); + mutableHeader.setSelectedHeader(mModel->bubbleId(current.row())); + mSelectionTimer->stop(); + mSelectionTimer->start(BUBBLE_SELECTION_TIMEOUT); + } } void BubbleConferenceHandler::clearSelection()