diff --git a/src/repo-service-helper.cpp b/src/repo-service-helper.cpp index c80ae3909..a2a25e54a 100644 --- a/src/repo-service-helper.cpp +++ b/src/repo-service-helper.cpp @@ -109,9 +109,9 @@ void FileDownloadHelper::downloadFile(const QString &id) task->setAutoDelete(false); FileBrowserProgressDialog dialog(task.data(), parent_); if (dialog.exec()) { - QString full_path = - data_mgr->getLocalCachedFile(repo_.id, path_, task->fileId()); - if (!full_path.isEmpty()) + // The progress dialog exits after the download task is finished. However, data_mgr->getLocalCachedFile() doesn't work here because the local cache will be updated afterwards in another callback. + QString full_path = DataManager::getLocalCacheFilePath(repo_.id, path_); + if (!full_path.isEmpty() && QFileInfo(full_path).exists()) openFile(full_path, true); break; }