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

Method update

Telegram/SourceFiles/overview/overview_layout.cpp:323–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321RadialProgressItem::~RadialProgressItem() = default;
322
323void StatusText::update(
324 int64 newSize,
325 int64 fullSize,
326 TimeId duration,
327 TimeId realDuration) {
328 setSize(newSize);
329 if (_size == Ui::FileStatusSizeReady) {
330 _text = (duration >= 0) ? Ui::FormatDurationAndSizeText(duration, fullSize) : (duration < -1 ? Ui::FormatGifAndSizeText(fullSize) : Ui::FormatSizeText(fullSize));
331 } else if (_size == Ui::FileStatusSizeLoaded) {
332 _text = (duration >= 0) ? Ui::FormatDurationText(duration) : (duration < -1 ? u"GIF"_q : Ui::FormatSizeText(fullSize));
333 } else if (_size == Ui::FileStatusSizeFailed) {
334 _text = tr::lng_attach_failed(tr::now);
335 } else if (_size >= 0) {
336 _text = Ui::FormatDownloadText(_size, fullSize);
337 } else {
338 _text = Ui::FormatPlayedText(-_size - 1, realDuration);
339 }
340}
341
342void StatusText::setSize(int64 newSize) {
343 _size = newSize;

Callers 3

updateStatusTextMethod · 0.45
DocumentMethod · 0.45

Calls 7

FormatGifAndSizeTextFunction · 0.85
FormatSizeTextFunction · 0.85
FormatDurationTextFunction · 0.85
FormatDownloadTextFunction · 0.85
FormatPlayedTextFunction · 0.85
repaintItemMethod · 0.45

Tested by

no test coverage detected