2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Moved emoji sets and dictionaries loader states to CloudBlob.

- Moved CloudBlob to second namespace.
This commit is contained in:
23rd
2020-02-05 16:06:38 +03:00
parent 9f4d05b04c
commit 704dcc8d65
6 changed files with 65 additions and 93 deletions

View File

@@ -31,7 +31,9 @@ namespace Ui {
namespace Emoji {
namespace {
struct Set : public Storage::Blob {
using namespace Storage::CloudBlob;
struct Set : public Blob {
QString previewPath;
};
@@ -50,41 +52,7 @@ auto Sets() {
return kSets;
}
struct Available {
int size = 0;
inline bool operator<(const Available &other) const {
return size < other.size;
}
inline bool operator==(const Available &other) const {
return size == other.size;
}
};
struct Ready {
inline bool operator<(const Ready &other) const {
return false;
}
inline bool operator==(const Ready &other) const {
return true;
}
};
struct Active {
inline bool operator<(const Active &other) const {
return false;
}
inline bool operator==(const Active &other) const {
return true;
}
};
using Loading = MTP::DedicatedLoader::Progress;
struct Failed {
inline bool operator<(const Failed &other) const {
return false;
}
inline bool operator==(const Failed &other) const {
return true;
}
};
using SetState = base::variant<
Available,
Ready,
@@ -224,7 +192,7 @@ bool GoodSetPartName(const QString &name) {
}
bool UnpackSet(const QString &path, const QString &folder) {
return Storage::UnpackBlob(path, folder, GoodSetPartName);
return UnpackBlob(path, folder, GoodSetPartName);
}
Loader::Loader(QObject *parent, int id)