mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-24 12:40:55 -04:00
Got rid of ContentManager::startDownload()
This commit is contained in:
parent
6bbbe7dafc
commit
f8a140404e
@ -595,14 +595,6 @@ QString ContentManager::getRemoteLibraryUrl() const
|
||||
: "http://" + host + ":" + QString::number(port);
|
||||
}
|
||||
|
||||
std::string ContentManager::startDownload(const kiwix::Book& book)
|
||||
{
|
||||
auto downloadPath = getSettingsManager()->getDownloadDir();
|
||||
checkThatBookCanBeSaved(book, downloadPath);
|
||||
|
||||
return DownloadManager::startDownload(book, downloadPath.toStdString());
|
||||
}
|
||||
|
||||
void ContentManager::downloadBook(const QString &id)
|
||||
{
|
||||
if ( ! DownloadManager::downloadingFunctionalityAvailable() )
|
||||
@ -610,11 +602,12 @@ void ContentManager::downloadBook(const QString &id)
|
||||
|
||||
const auto& book = getRemoteOrLocalBook(id);
|
||||
|
||||
const auto downloadPath = getSettingsManager()->getDownloadDir();
|
||||
checkThatBookCanBeSaved(book, downloadPath);
|
||||
|
||||
std::string downloadId;
|
||||
try {
|
||||
downloadId = startDownload(book);
|
||||
} catch (const ContentManagerError& ) {
|
||||
throw;
|
||||
downloadId = DownloadManager::startDownload(book, downloadPath.toStdString());
|
||||
} catch (std::exception& e) {
|
||||
throwDownloadUnavailableError();
|
||||
}
|
||||
|
@ -121,7 +121,6 @@ private: // functions
|
||||
const kiwix::Book& getRemoteOrLocalBook(const QString &id);
|
||||
QString getRemoteLibraryUrl() const;
|
||||
|
||||
std::string startDownload(const kiwix::Book& book);
|
||||
void removeDownload(QString bookId);
|
||||
void downloadStarted(const kiwix::Book& book, const std::string& downloadId);
|
||||
void downloadDisappeared(QString bookId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user