diff --git a/src/contentmanagermodel.cpp b/src/contentmanagermodel.cpp index c25ee59..bab8244 100644 --- a/src/contentmanagermodel.cpp +++ b/src/contentmanagermodel.cpp @@ -265,7 +265,6 @@ void ContentManagerModel::cancelDownload(QModelIndex index) { auto node = static_cast(index.internalPointer()); node->setIsDownloading(false); // this stops & deletes the timer - node->setDownloadInfo({0, "", "", false}); emit dataChanged(index, index); } diff --git a/src/rownode.cpp b/src/rownode.cpp index 86a9d80..0d86f4b 100644 --- a/src/rownode.cpp +++ b/src/rownode.cpp @@ -93,6 +93,7 @@ void DownloadState::setIsDownloading(bool val) // of any events that may be in the process of being delivered to it // from another thread. m_downloadUpdateTimer.reset(); + m_downloadInfo = {0, "", "", false}; } } @@ -123,7 +124,7 @@ void DownloadState::updateDownloadStatus(QString id) percent = QString::number(percent, 'g', 3).toDouble(); auto completedLength = convertToUnits(downloadInfos["completedLength"].toString()); auto downloadSpeed = convertToUnits(downloadInfos["downloadSpeed"].toString()) + "/s"; - setDownloadInfo({percent, completedLength, downloadSpeed, false}); + m_downloadInfo = {percent, completedLength, downloadSpeed, false}; if (!downloadInfos["status"].isValid()) { setIsDownloading(false); // this stops & deletes the timer } diff --git a/src/rownode.h b/src/rownode.h index 6c89bce..c07a4c8 100644 --- a/src/rownode.h +++ b/src/rownode.h @@ -20,7 +20,6 @@ public: DownloadState(); bool isDownloading() const { return m_downloadUpdateTimer.get() != nullptr; } - void setDownloadInfo(DownloadInfo downloadInfo) { m_downloadInfo = downloadInfo; } DownloadInfo getDownloadInfo() const { return m_downloadInfo; } QTimer* getDownloadUpdateTimer() const { return m_downloadUpdateTimer.get(); } void setIsDownloading(bool val);