ContentManager::download{Cancelled->Disappeared}()

Renamed `ContentManager::downloadCancelled()` to `downloadDisappeared()`
since the situation handled by that function is unrelated to cancelling
a download (in which case it should still be available with a status of
"removed").
This commit is contained in:
Veloman Yunkan 2024-03-01 18:33:00 +04:00
parent a0d3f5a7b3
commit 6c095adf8a
2 changed files with 3 additions and 3 deletions

View File

@ -402,7 +402,7 @@ void ContentManager::removeDownload(QString bookId)
managerModel->removeDownload(bookId);
}
void ContentManager::downloadCancelled(QString bookId)
void ContentManager::downloadDisappeared(QString bookId)
{
removeDownload(bookId);
kiwix::Book bCopy(mp_library->getBookById(bookId));
@ -459,7 +459,7 @@ void ContentManager::updateDownload(QString bookId)
const auto downloadInfo = getDownloadInfo(bookId);
if ( downloadInfo.isEmpty() ) {
downloadCancelled(bookId);
downloadDisappeared(bookId);
} else if ( downloadInfo["status"] == "completed" ) {
downloadCompleted(bookId, downloadInfo["path"].toString());
} else {

View File

@ -86,7 +86,7 @@ private: // functions
void updateDownload(QString bookId);
void removeDownload(QString bookId);
void downloadStarted(const kiwix::Book& book, const std::string& downloadId);
void downloadCancelled(QString bookId);
void downloadDisappeared(QString bookId);
void downloadCompleted(QString bookId, QString path);
DownloadInfo getDownloadInfo(QString bookId) const;