ContentManager::updateDownload()

This commit is contained in:
Veloman Yunkan 2024-02-10 15:51:10 +04:00
parent d3c4361d60
commit 582dce0ced
2 changed files with 9 additions and 1 deletions

View File

@ -476,6 +476,13 @@ ContentManager::DownloadInfo ContentManager::updateDownloadInfos(QString bookId,
return result;
}
void ContentManager::updateDownload(QString bookId)
{
// This calls ContentManager::updateDownloadInfos() in a convoluted way
// and also has some other side-effects
managerModel->updateDownload(bookId);
}
namespace
{
@ -497,7 +504,7 @@ void ContentManager::downloadBook(const QString &id, QModelIndex index)
node->setDownloadState(newDownload);
QTimer *timer = newDownload->getDownloadUpdateTimer();
connect(timer, &QTimer::timeout, [=]() {
managerModel->updateDownload(id);
this->updateDownload(id);
});
}
catch ( const ContentManagerError& err )

View File

@ -86,6 +86,7 @@ private: // functions
const kiwix::Book& getRemoteOrLocalBook(const QString &id);
std::string startDownload(const kiwix::Book& book);
void updateDownload(QString bookId);
void downloadStarted(const kiwix::Book& book, const std::string& downloadId);
void downloadCancelled(QString bookId);
void downloadCompleted(QString bookId, QString path);