Skip to content
Snippets Groups Projects
Commit 5afc29a2 authored by Emmanuel Lepage's avatar Emmanuel Lepage
Browse files

[ #11731 ] Fix visual glitch when hang up, harden against 0 participant conference

parent 54e3b7fd
Branches
Tags
No related merge requests found
......@@ -86,6 +86,7 @@ CallView::CallView(QWidget* parent) : QTreeWidget(parent),m_pActiveOverlay(0),m_
}
foreach(Call* active, SFLPhone::model()->getConferenceList()) {
if (qobject_cast<Call*>(active)) //As of May 2012, the deamon still produce fake conferences
addConference(active);
}
......@@ -557,10 +558,6 @@ void CallView::destroyCall(Call* toDestroy)
SFLPhone::model()->getIndex(toDestroy)->parent()->removeChild(SFLPhone::model()->getIndex(toDestroy));
if (parent->childCount() == 0) /*This should never happen, but it does*/
takeTopLevelItem(indexOfTopLevelItem(parent));
else if (parent->childCount() == 1) {
addTopLevelItem(extractItem(parent->child(0)));
takeTopLevelItem(indexOfTopLevelItem(parent));
} //TODO make sure it just never happen and remove this logic code
}
else
kDebug() << "Call not found";
......@@ -649,8 +646,6 @@ bool CallView::conferenceChanged(Call* conf)
{
if (!dynamic_cast<Call*>(conf)) return false;
kDebug() << "Conference changed";
//if (!SFLPhone::model()->conferenceChanged(confId, state))
// return false;
CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance();
QStringList callList = callManager.getParticipantList(conf->getConfId());
......@@ -666,10 +661,11 @@ bool CallView::conferenceChanged(Call* conf)
kDebug() << "Call " << callId << " does not exist";
}
if (SFLPhone::model()->getIndex(conf)) /*Can happen is the daemon crashed*/
for (int j =0; j < SFLPhone::model()->getIndex(conf)->childCount();j++) {
if (buffer.indexOf(SFLPhone::model()->getIndex(conf)->child(j)) == -1)
insertItem(extractItem(SFLPhone::model()->getIndex(conf)->child(j)));
QTreeWidgetItem* item = SFLPhone::model()->getIndex(conf);
if (item) /*Can happen if the daemon crashed*/
for (int j =0; j < item->childCount();j++) {
if (buffer.indexOf(item->child(j)) == -1)
insertItem(extractItem(item->child(j)));
}
Q_ASSERT_X(SFLPhone::model()->getIndex(conf)->childCount() == 0,"changing conference","A conference can't have no participants");
......
......@@ -785,6 +785,8 @@ CALLMODEL_TEMPLATE bool CALLMODEL_T::updateWidget (Call* call, CallWidget va
CALLMODEL_TEMPLATE bool CALLMODEL_T::updateIndex (Call* call, Index value )
{
updateCommon(call);
if (!m_sPrivateCallList_call[call])
return false;
m_sPrivateCallList_call[call]->index = value ;
m_sPrivateCallList_index[value] = m_sPrivateCallList_call[call] ;
return true;
......
......@@ -92,6 +92,9 @@ Call* CallTreeItem::call() const
///Set the call item
void CallTreeItem::setCall(Call *call)
{
if (!call)
return;
m_pItemCall = call;
setAcceptDrops(true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment