MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / userpicCloudImage

Method userpicCloudImage

Telegram/SourceFiles/data/data_peer.cpp:435–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

433}
434
435QImage *PeerData::userpicCloudImage(Ui::PeerUserpicView &view) const {
436 if (!_userpic.isCurrentView(view.cloud)) {
437 if (!_userpic.empty()) {
438 view.cloud = _userpic.createView();
439 _userpic.load(&session(), userpicOrigin());
440 } else {
441 view.cloud = nullptr;
442 }
443 view.cached = QImage();
444 }
445 if (const auto image = view.cloud.get(); image && !image->isNull()) {
446 _userpicEmpty = nullptr;
447 return image;
448 } else if (isNotificationsUser()) {
449 static auto result = Window::LogoNoMargin().scaledToWidth(
450 kUserpicSize,
451 Qt::SmoothTransformation);
452 return &result;
453 }
454 return nullptr;
455}
456
457void PeerData::paintUserpic(
458 QPainter &p,

Callers 5

GenerateUserpicImageMethod · 0.80
SessionMethod · 0.80
refreshPhotoMethod · 0.80
prepareUserpicPixmapMethod · 0.80
paintUserpicMethod · 0.80

Calls 7

isCurrentViewMethod · 0.80
QImageClass · 0.50
emptyMethod · 0.45
createViewMethod · 0.45
loadMethod · 0.45
getMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected