mirror of
https://github.com/savoirfairelinux/jami-client-qt.git
synced 2025-12-19 01:52:30 +08:00
qml interop: refactor and remove utilsadapter from clientwrapper
- Separate utilsadapter into files and expose it to Qml so it can be used without passing through clientwrapper. Change-Id: I7c351d7191cd166521b6e0a685ea9d4a9731f165 Gitlab: #66
This commit is contained in:
@@ -106,26 +106,22 @@ PixbufManipulator::decorationRole(const lrc::api::conversation::Info &conversati
|
||||
auto bestId = Utils::bestIdForContact(contactInfo);
|
||||
if (accountInfo.profileInfo.type == lrc::api::profile::Type::SIP
|
||||
&& contactInfo.profileInfo.type == lrc::api::profile::Type::TEMPORARY) {
|
||||
photo = Utils::fallbackAvatar(IMAGE_SIZE, QString(), QString());
|
||||
photo = Utils::fallbackAvatar(QString(), QString());
|
||||
} else if (contactInfo.profileInfo.type == lrc::api::profile::Type::TEMPORARY
|
||||
&& contactInfo.profileInfo.uri.isEmpty()) {
|
||||
photo = Utils::fallbackAvatar(IMAGE_SIZE, QString(), QString());
|
||||
photo = Utils::fallbackAvatar(QString(), QString());
|
||||
} else if (!contactPhoto.isEmpty()) {
|
||||
QByteArray byteArray = contactPhoto.toLocal8Bit();
|
||||
photo = personPhoto(byteArray, nullptr).value<QImage>();
|
||||
if (photo.isNull()) {
|
||||
auto avatarName = contactInfo.profileInfo.uri == bestName ? QString() : bestName;
|
||||
photo = Utils::fallbackAvatar(IMAGE_SIZE,
|
||||
"ring:" + contactInfo.profileInfo.uri,
|
||||
avatarName);
|
||||
photo = Utils::fallbackAvatar("ring:" + contactInfo.profileInfo.uri, avatarName);
|
||||
}
|
||||
} else {
|
||||
auto avatarName = contactInfo.profileInfo.uri == bestName ? QString() : bestName;
|
||||
photo = Utils::fallbackAvatar(IMAGE_SIZE,
|
||||
"ring:" + contactInfo.profileInfo.uri,
|
||||
avatarName);
|
||||
photo = Utils::fallbackAvatar("ring:" + contactInfo.profileInfo.uri, avatarName);
|
||||
}
|
||||
} catch (...) {
|
||||
}
|
||||
return QVariant::fromValue(Utils::scaleAndFrame(photo, IMAGE_SIZE));
|
||||
}
|
||||
return QVariant::fromValue(Utils::scaleAndFrame(photo));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user