Commit ad0fabb5 authored by Olivier SOLDANO's avatar Olivier SOLDANO

ui: set avatar on outgoing calls

avatar was not set on outgoing calls due to wrong
interraction between pixbufmanipulator and callwidget
resulting in a fallback avatar for all contacts in the
callingPhoto Qlabel

Change-Id: I348351618288613e7e7f6fb2cbf78e36a19c5b5f
parent cd159bc5
......@@ -601,7 +601,13 @@ CallWidget::on_smartList_doubleClicked(const QModelIndex& index)
m = person->phoneNumbers().first();
}
}
if (m && !RecentModel::instance().index(0, 0, realIndex).isValid()) {
QPixmap map = QPixmap::fromImage(
GlobalInstances::pixmapManipulator().callPhoto(m, QSize(130,130)).value<QImage>());
ui->callingPhoto->setPixmap(map);
Call* c = CallModel::instance().dialingCall(m);
c->performAction(Call::Action::ACCEPT);
setActualCall(c);
......@@ -735,7 +741,7 @@ CallWidget::showIMOutOfCall(const QModelIndex& nodeIdx)
foreach (const ContactMethod* cm, cmVector) {
ui->contactMethodComboBox->addItem(cm->uri());
}
slidePage(ui->messagingPage, true);
ui->stackedWidget->setCurrentWidget(ui->messagingPage);
disconnect(imClickedConnection_);
imClickedConnection_ = connect(ui->listMessageView, &QListView::clicked, [this](const QModelIndex& index) {
auto urlList = index.data(static_cast<int>(Media::TextRecording::Role::LinkList)).value<QList<QUrl>>();
......
......@@ -60,8 +60,9 @@ PixbufManipulator::scaleAndFrame(const QImage photo, const QSize& size)
QVariant
PixbufManipulator::callPhoto(Call* c, const QSize& size, bool displayPresence)
{
if (!c || c->type() == Call::Type::CONFERENCE)
if (!c || c->type() == Call::Type::CONFERENCE){
return QVariant::fromValue(scaleAndFrame(fallbackAvatar_, size));
}
return callPhoto(c->peerContactMethod(), size, displayPresence);
}
......@@ -87,11 +88,11 @@ PixbufManipulator::contactPhoto(Person* c, const QSize& size, bool displayPresen
QImage photo;
if (c->photo().isValid())
if (c->photo().isValid()){
photo = c->photo().value<QImage>();
else
} else {
photo = fallbackAvatar_;
}
return QVariant::fromValue(scaleAndFrame(photo, size));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment