2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Divide data/data_peer and remove from PCH.

This commit is contained in:
John Preston
2019-01-04 15:09:48 +04:00
parent 0ce4d66601
commit c5a41e1f55
143 changed files with 2291 additions and 1899 deletions

View File

@@ -168,6 +168,10 @@ void FileLoader::readImage(const QSize &shrinkBox) const {
}
}
Data::FileOrigin FileLoader::fileOrigin() const {
return Data::FileOrigin();
}
float64 FileLoader::currentProgress() const {
if (_finished) return 1.;
if (!fullSize()) return 0.;
@@ -592,19 +596,19 @@ Data::FileOrigin mtpFileLoader::fileOrigin() const {
}
void mtpFileLoader::refreshFileReferenceFrom(
const Data::UpdatedFileReferences &data,
const Data::UpdatedFileReferences &updates,
int requestId,
const QByteArray &current) {
const auto updated = [&] {
if (_location) {
const auto i = data.find(Data::SimpleFileLocationId(
const auto i = updates.data.find(Data::SimpleFileLocationId(
_location->volume(),
_location->dc(),
_location->local()));
return (i == end(data)) ? QByteArray() : i->second;
return (i == end(updates.data)) ? QByteArray() : i->second;
}
const auto i = data.find(_id);
return (i == end(data)) ? QByteArray() : i->second;
const auto i = updates.data.find(_id);
return (i == end(updates.data)) ? QByteArray() : i->second;
}();
if (updated.isEmpty() || updated == current) {
cancel(true);