mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-20 18:33:38 -04:00
DownloadManager::startDownloadUpdaterThread()
Moved the download updater thread from ContentManager to DownloadManager.
This commit is contained in:
parent
e5f4a4b55f
commit
8fbb867270
@ -154,7 +154,7 @@ ContentManager::ContentManager(Library* library, kiwix::Downloader* downloader)
|
||||
}
|
||||
}
|
||||
|
||||
void ContentManager::startDownloadUpdaterThread()
|
||||
void DownloadManager::startDownloadUpdaterThread()
|
||||
{
|
||||
// so that DownloadInfo can be copied across threads
|
||||
qRegisterMetaType<DownloadInfo>("DownloadInfo");
|
||||
@ -168,7 +168,7 @@ void ContentManager::startDownloadUpdaterThread()
|
||||
mp_downloadUpdaterThread->start();
|
||||
}
|
||||
|
||||
ContentManager::~ContentManager()
|
||||
DownloadManager::~DownloadManager()
|
||||
{
|
||||
if ( mp_downloadUpdaterThread )
|
||||
{
|
||||
|
@ -59,7 +59,6 @@ public: // types
|
||||
|
||||
public: // functions
|
||||
ContentManager(Library* library, kiwix::Downloader *downloader);
|
||||
virtual ~ContentManager();
|
||||
|
||||
ContentManagerView* getView() { return mp_view; }
|
||||
void setLocal(bool local);
|
||||
@ -122,7 +121,6 @@ private: // functions
|
||||
const kiwix::Book& getRemoteOrLocalBook(const QString &id);
|
||||
QString getRemoteLibraryUrl() const;
|
||||
|
||||
void startDownloadUpdaterThread();
|
||||
std::string startDownload(const kiwix::Book& book);
|
||||
void removeDownload(QString bookId);
|
||||
void downloadStarted(const kiwix::Book& book, const std::string& downloadId);
|
||||
@ -132,7 +130,6 @@ private: // functions
|
||||
private: // data
|
||||
Library* mp_library;
|
||||
kiwix::LibraryPtr mp_remoteLibrary;
|
||||
QThread* mp_downloadUpdaterThread = nullptr;
|
||||
OpdsRequestManager m_remoteLibraryManager;
|
||||
ContentManagerView* mp_view;
|
||||
bool m_local = true;
|
||||
|
@ -70,6 +70,9 @@ private:
|
||||
|
||||
public: // functions
|
||||
DownloadManager(const Library* lib, kiwix::Downloader *downloader);
|
||||
virtual ~DownloadManager();
|
||||
|
||||
void startDownloadUpdaterThread();
|
||||
|
||||
DownloadInfo getDownloadInfo(QString bookId) const;
|
||||
void restoreDownloads();
|
||||
@ -97,6 +100,7 @@ protected: // data
|
||||
|
||||
private:
|
||||
Downloads m_downloads;
|
||||
QThread* mp_downloadUpdaterThread = nullptr;
|
||||
};
|
||||
|
||||
#endif // DOWNLOADMANAGEMENT_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user