mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-06 09:26:18 +00:00
Don't unload all media on switching between chats.
This commit is contained in:
@@ -37,7 +37,7 @@ QImage ImageSource::takeLoaded() {
|
||||
return _data;
|
||||
}
|
||||
|
||||
void ImageSource::forget() {
|
||||
void ImageSource::unload() {
|
||||
}
|
||||
|
||||
void ImageSource::automaticLoad(
|
||||
@@ -161,7 +161,7 @@ QImage LocalFileSource::takeLoaded() {
|
||||
return std::move(_data);
|
||||
}
|
||||
|
||||
void LocalFileSource::forget() {
|
||||
void LocalFileSource::unload() {
|
||||
_data = QImage();
|
||||
}
|
||||
|
||||
@@ -361,10 +361,6 @@ void RemoteSource::loadEvenCancelled(
|
||||
return load(origin, loadFirst, prior);
|
||||
}
|
||||
|
||||
RemoteSource::~RemoteSource() {
|
||||
forget();
|
||||
}
|
||||
|
||||
bool RemoteSource::displayLoading() {
|
||||
return loaderValid()
|
||||
&& (!_loader->loadingLocal() || !_loader->autoLoading());
|
||||
@@ -380,7 +376,7 @@ void RemoteSource::cancel() {
|
||||
std::unique_ptr<FileLoader>(loader));
|
||||
}
|
||||
|
||||
void RemoteSource::forget() {
|
||||
void RemoteSource::unload() {
|
||||
if (loaderValid()) {
|
||||
destroyLoaderDelayed();
|
||||
}
|
||||
@@ -394,6 +390,10 @@ int RemoteSource::loadOffset() {
|
||||
return loaderValid() ? _loader->currentOffset() : 0;
|
||||
}
|
||||
|
||||
RemoteSource::~RemoteSource() {
|
||||
unload();
|
||||
}
|
||||
|
||||
const StorageImageLocation &RemoteSource::location() {
|
||||
return StorageImageLocation::Null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user