With last version of libkiwix, Downloader now return shared_ptr<Download>.

This commit is contained in:
Matthieu Gautier 2023-02-09 09:47:47 +01:00
parent 3c50eee9eb
commit 1b322d8f01

View File

@ -173,7 +173,7 @@ QStringList ContentManager::updateDownloadInfos(QString id, const QStringList &k
return values; return values;
} }
auto& b = mp_library->getBookById(id); auto& b = mp_library->getBookById(id);
kiwix::Download* d; std::shared_ptr<kiwix::Download> d;
try { try {
d = mp_downloader->getDownload(b.getDownloadId()); d = mp_downloader->getDownload(b.getDownloadId());
} catch(...) { } catch(...) {
@ -270,7 +270,7 @@ QString ContentManager::downloadBook(const QString &id)
for (auto b : booksList) for (auto b : booksList)
if (b.toStdString() == book.getId()) if (b.toStdString() == book.getId())
return ""; return "";
kiwix::Download *download; std::shared_ptr<kiwix::Download> download;
try { try {
std::pair<std::string, std::string> downloadDir("dir", downloadPath.toStdString()); std::pair<std::string, std::string> downloadDir("dir", downloadPath.toStdString());
const std::vector<std::pair<std::string, std::string>> options = { downloadDir }; const std::vector<std::pair<std::string, std::string>> options = { downloadDir };