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

rpcClear for mediaview, ImageLink changed to Location

This commit is contained in:
John Preston
2016-02-28 16:54:04 +03:00
parent 5b345cbc2d
commit 0e49c13968
13 changed files with 108 additions and 136 deletions

View File

@@ -49,8 +49,8 @@ namespace {
PhotosData photosData;
DocumentsData documentsData;
typedef QHash<QString, ImageLinkData*> ImageLinksData;
ImageLinksData imageLinksData;
typedef QHash<LocationCoords, LocationData*> LocationsData;
LocationsData locationsData;
typedef QHash<WebPageId, WebPageData*> WebPagesData;
WebPagesData webPagesData;
@@ -1671,27 +1671,14 @@ namespace App {
return result;
}
ImageLinkData *imageLink(const QString &imageLink) {
ImageLinksData::const_iterator i = imageLinksData.constFind(imageLink);
if (i == imageLinksData.cend()) {
i = imageLinksData.insert(imageLink, new ImageLinkData(imageLink));
LocationData *location(const LocationCoords &coords) {
LocationsData::const_iterator i = locationsData.constFind(coords);
if (i == locationsData.cend()) {
i = locationsData.insert(coords, new LocationData(coords));
}
return i.value();
}
ImageLinkData *imageLinkSet(const QString &imageLink, ImageLinkType type) {
ImageLinksData::const_iterator i = imageLinksData.constFind(imageLink);
ImageLinkData *result;
if (i == imageLinksData.cend()) {
result = new ImageLinkData(imageLink);
imageLinksData.insert(imageLink, result);
result->type = type;
} else {
result = i.value();
}
return result;
}
void forgetMedia() {
lastPhotos.clear();
lastPhotosMap.clear();
@@ -1701,7 +1688,7 @@ namespace App {
for (DocumentsData::const_iterator i = ::documentsData.cbegin(), e = ::documentsData.cend(); i != e; ++i) {
i.value()->forget();
}
for (ImageLinksData::const_iterator i = imageLinksData.cbegin(), e = imageLinksData.cend(); i != e; ++i) {
for (LocationsData::const_iterator i = ::locationsData.cbegin(), e = ::locationsData.cend(); i != e; ++i) {
i.value()->thumb->forget();
}
}