mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 19:46:12 -04:00
ContentManager::updateDownload() became a slot
This commit is contained in:
parent
32e3c743f7
commit
b6a86918ff
@ -133,6 +133,9 @@ ContentManager::ContentManager(Library* library, kiwix::Downloader* downloader,
|
|||||||
m_downloadUpdateTimer.start(1000);
|
m_downloadUpdateTimer.start(1000);
|
||||||
connect(&m_downloadUpdateTimer, &QTimer::timeout,
|
connect(&m_downloadUpdateTimer, &QTimer::timeout,
|
||||||
this, &ContentManager::updateDownloads);
|
this, &ContentManager::updateDownloads);
|
||||||
|
|
||||||
|
connect(this, &ContentManager::downloadUpdated,
|
||||||
|
this, &ContentManager::updateDownload);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentManager::updateModel()
|
void ContentManager::updateModel()
|
||||||
@ -497,7 +500,7 @@ void ContentManager::updateDownloads()
|
|||||||
for ( const auto& bookId : m_downloads.keys() ) {
|
for ( const auto& bookId : m_downloads.keys() ) {
|
||||||
const auto downloadInfo = getDownloadInfo(bookId);
|
const auto downloadInfo = getDownloadInfo(bookId);
|
||||||
|
|
||||||
updateDownload(bookId, downloadInfo);
|
emit downloadUpdated(bookId, downloadInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ signals:
|
|||||||
void categoriesLoaded(QStringList);
|
void categoriesLoaded(QStringList);
|
||||||
void languagesLoaded(LanguageList);
|
void languagesLoaded(LanguageList);
|
||||||
void localChanged(const bool);
|
void localChanged(const bool);
|
||||||
|
void downloadUpdated(QString bookId, const DownloadInfo& );
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
QStringList getTranslations(const QStringList &keys);
|
QStringList getTranslations(const QStringList &keys);
|
||||||
@ -66,6 +67,7 @@ public slots:
|
|||||||
void onCustomContextMenu(const QPoint &point);
|
void onCustomContextMenu(const QPoint &point);
|
||||||
void openBookWithIndex(const QModelIndex& index);
|
void openBookWithIndex(const QModelIndex& index);
|
||||||
void updateDownloads();
|
void updateDownloads();
|
||||||
|
void updateDownload(QString bookId, const DownloadInfo& downloadInfo);
|
||||||
|
|
||||||
private: // functions
|
private: // functions
|
||||||
QStringList getBookIds();
|
QStringList getBookIds();
|
||||||
@ -83,7 +85,6 @@ private: // functions
|
|||||||
const kiwix::Book& getRemoteOrLocalBook(const QString &id);
|
const kiwix::Book& getRemoteOrLocalBook(const QString &id);
|
||||||
|
|
||||||
std::string startDownload(const kiwix::Book& book);
|
std::string startDownload(const kiwix::Book& book);
|
||||||
void updateDownload(QString bookId, const DownloadInfo& downloadInfo);
|
|
||||||
void removeDownload(QString bookId);
|
void removeDownload(QString bookId);
|
||||||
void downloadStarted(const kiwix::Book& book, const std::string& downloadId);
|
void downloadStarted(const kiwix::Book& book, const std::string& downloadId);
|
||||||
void downloadDisappeared(QString bookId);
|
void downloadDisappeared(QString bookId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user