2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Remove legacy image-related code.

This commit is contained in:
John Preston
2020-05-29 18:08:18 +04:00
parent f066e0f05a
commit 6513422e40
60 changed files with 161 additions and 1509 deletions

View File

@@ -28,6 +28,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mainwindow.h"
#include "window/window_session_controller.h"
#include "ui/image/image.h"
#include "ui/image/image_source.h"
#include "ui/empty_userpic.h"
#include "ui/text_options.h"
#include "history/history.h"
@@ -217,6 +218,13 @@ Image *PeerData::currentUserpic(
const auto image = view ? view->image() : nullptr;
if (image) {
_userpicEmpty = nullptr;
} else if (isNotificationsUser()) {
static auto result = Image(
std::make_unique<Images::ImageSource>(
Core::App().logoNoMargin().scaledToWidth(
kUserpicSize,
Qt::SmoothTransformation)));
return &result;
}
return image;
}
@@ -370,17 +378,6 @@ void PeerData::updateUserpic(
}
void PeerData::clearUserpic() {
//const auto photo = [&] { // #TODO optimize
// if (isNotificationsUser()) {
// auto image = Core::App().logoNoMargin().scaledToWidth(
// kUserpicSize,
// Qt::SmoothTransformation);
// return _userpic
// ? _userpic
// : Images::Create(std::move(image), "PNG");
// }
// return ImagePtr();
//}();
setUserpicChecked(PhotoId(), ImageLocation());
}