Skip to content
Snippets Groups Projects
Commit 7e61d368 authored by Jérémy Quentin's avatar Jérémy Quentin
Browse files

[redmine_down] crash when hanging up a dialing call because tries to add it to...

[redmine_down] crash when hanging up a dialing call because tries to add it to history whereas no starttime
parent 651aa3d4
No related branches found
No related tags found
No related merge requests found
...@@ -431,8 +431,10 @@ QWidget * Call::getHistoryItemWidget() ...@@ -431,8 +431,10 @@ QWidget * Call::getHistoryItemWidget()
labelHistoryIcon = new QLabel(); labelHistoryIcon = new QLabel();
labelHistoryIcon->setPixmap(QPixmap(historyIcons[historyState])); labelHistoryIcon->setPixmap(QPixmap(historyIcons[historyState]));
labelHistoryCallNumber = new QLabel(peerPhoneNumber); labelHistoryCallNumber = new QLabel(peerPhoneNumber);
if(startTime)
labelHistoryTime = new QLabel(startTime->toString(Qt::LocaleDate)); labelHistoryTime = new QLabel(startTime->toString(Qt::LocaleDate));
else
labelHistoryTime = new QLabel();
QSpacerItem * horizontalSpacer = new QSpacerItem(16777215, 20, QSizePolicy::Preferred, QSizePolicy::Minimum); QSpacerItem * horizontalSpacer = new QSpacerItem(16777215, 20, QSizePolicy::Preferred, QSizePolicy::Minimum);
QHBoxLayout * mainLayout = new QHBoxLayout(); QHBoxLayout * mainLayout = new QHBoxLayout();
......
...@@ -428,15 +428,19 @@ void SFLPhoneView::action(Call * call, call_action action) ...@@ -428,15 +428,19 @@ void SFLPhoneView::action(Call * call, call_action action)
void SFLPhoneView::updateCallItem(Call * call) void SFLPhoneView::updateCallItem(Call * call)
{ {
if(!call) return;
call_state state = call->getState(); call_state state = call->getState();
if(state == CALL_STATE_OVER) if(state == CALL_STATE_OVER)
{ {
QListWidgetItem * item = call->getItem(); QListWidgetItem * item = call->getItem();
qDebug() << "Updating call with CALL_STATE_OVER. Deleting item " << (*callList)[item]->getCallId(); qDebug() << "Updating call with CALL_STATE_OVER. Deleting item " << (*callList)[item]->getCallId();
listWidget_callList->takeItem(listWidget_callList->row(item)); listWidget_callList->takeItem(listWidget_callList->row(item));
if(call->getHistoryState() != NONE)
{
addCallToCallHistory(call); addCallToCallHistory(call);
} }
} }
}
void SFLPhoneView::updateWindowCallState() void SFLPhoneView::updateWindowCallState()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment