2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Keep document byte data only in DocumentMedia.

This commit is contained in:
John Preston
2020-04-10 17:18:51 +04:00
parent 97bab388ea
commit 40f12a2584
26 changed files with 280 additions and 241 deletions

View File

@@ -35,6 +35,8 @@ public:
void setBytes(const QByteArray &bytes);
[[nodiscard]] QByteArray bytes() const;
[[nodiscard]] bool loaded(bool check = false) const;
[[nodiscard]] float64 progress() const;
[[nodiscard]] bool canBePlayed() const;
// For DocumentData.
static void CheckGoodThumbnail(not_null<DocumentData*> document);
@@ -47,7 +49,9 @@ private:
using Flags = base::flags<Flag>;
static void ReadOrGenerateThumbnail(not_null<DocumentData*> document);
static void GenerateGoodThumbnail(not_null<DocumentData*> document);
static void GenerateGoodThumbnail(
not_null<DocumentData*> document,
QByteArray data);
const not_null<DocumentData*> _owner;
std::unique_ptr<Image> _goodThumbnail;