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

Moved producer of state description to CloudBlob.

This commit is contained in:
23rd
2020-02-05 17:28:22 +03:00
parent 8ca0b614d7
commit efdf5f1767
4 changed files with 40 additions and 41 deletions

View File

@@ -17,7 +17,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/emoji_config.h"
#include "lang/lang_keys.h"
#include "base/zlib_help.h"
#include "layout.h"
#include "core/application.h"
#include "main/main_account.h"
#include "mainwidget.h"
@@ -149,25 +148,9 @@ SetState ComputeState(int id) {
}
QString StateDescription(const SetState &state) {
return state.match([](const Available &data) {
return tr::lng_emoji_set_download(tr::now, lt_size, formatSizeText(data.size));
}, [](const Ready &data) -> QString {
return tr::lng_emoji_set_ready(tr::now);
}, [](const Active &data) -> QString {
return tr::lng_emoji_set_active(tr::now);
}, [](const Loading &data) {
const auto percent = (data.size > 0)
? snap((data.already * 100) / float64(data.size), 0., 100.)
: 0.;
return tr::lng_emoji_set_loading(
tr::now,
lt_percent,
QString::number(int(std::round(percent))) + '%',
lt_progress,
formatDownloadText(data.already, data.size));
}, [](const Failed &data) {
return tr::lng_attach_failed(tr::now);
});
return StateDescription(
state,
tr::lng_emoji_set_active);
}
bool GoodSetPartName(const QString &name) {