Moved download deregistration to ContentManager

This commit is contained in:
Veloman Yunkan 2024-02-09 20:32:19 +04:00
parent 4842742e77
commit d3c4361d60
2 changed files with 2 additions and 1 deletions

View File

@ -666,6 +666,8 @@ void ContentManager::cancelBook(const QString& id)
if (download->getStatus() != kiwix::Download::K_COMPLETE) {
download->cancelDownload();
}
m_downloads.remove(id);
QString dirPath = QString::fromStdString(kiwix::removeLastPathElement(download->getPath()));
QString filename = QString::fromStdString(kiwix::getLastPathElement(download->getPath())) + "*";
// incompleted downloaded file should be perma deleted

View File

@ -282,7 +282,6 @@ void ContentManagerModel::resumeDownload(QModelIndex index)
void ContentManagerModel::removeDownload(QString bookId)
{
m_downloads.remove(bookId);
const auto it = bookIdToRowMap.constFind(bookId);
if ( it == bookIdToRowMap.constEnd() )
return;