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

Removed virtual type getters in mtpFileLoader.

This commit is contained in:
John Preston
2017-03-03 19:59:57 +03:00
parent f48d6dc464
commit 0838d21a05
2 changed files with 15 additions and 36 deletions

View File

@@ -1690,8 +1690,8 @@ void MainWidget::playerHeightUpdated() {
}
void MainWidget::documentLoadProgress(FileLoader *loader) {
if (auto mtpLoader = loader ? loader->mtpLoader() : nullptr) {
documentLoadProgress(App::document(mtpLoader->objId()));
if (auto documentId = loader ? loader->objId() : 0) {
documentLoadProgress(App::document(documentId));
}
}
@@ -1715,12 +1715,12 @@ void MainWidget::documentLoadProgress(DocumentData *document) {
}
void MainWidget::documentLoadFailed(FileLoader *loader, bool started) {
mtpFileLoader *l = loader ? loader->mtpLoader() : 0;
if (!l) return;
auto documentId = loader ? loader->objId() : 0;
if (!documentId) return;
auto document = App::document(l->objId());
auto document = App::document(documentId);
if (started) {
auto failedFileName = l->fileName();
auto failedFileName = loader->fileName();
Ui::show(Box<ConfirmBox>(lang(lng_download_finish_failed), base::lambda_guarded(this, [this, document, failedFileName] {
Ui::hideLayer();
if (document) document->save(failedFileName);