mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 11:37:56 -04:00
ContentManagerModel::triggerDataUpdateAt()
This commit is contained in:
parent
c8bd038a89
commit
8969d9ade3
@ -640,7 +640,7 @@ void ContentManager::pauseBook(const QString& id, QModelIndex index)
|
|||||||
download->pauseDownload();
|
download->pauseDownload();
|
||||||
m_downloads[id]->pause();
|
m_downloads[id]->pause();
|
||||||
}
|
}
|
||||||
emit managerModel->pauseDownload(index);
|
managerModel->triggerDataUpdateAt(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentManager::resumeBook(const QString& id, QModelIndex index)
|
void ContentManager::resumeBook(const QString& id, QModelIndex index)
|
||||||
@ -651,7 +651,7 @@ void ContentManager::resumeBook(const QString& id, QModelIndex index)
|
|||||||
download->resumeDownload();
|
download->resumeDownload();
|
||||||
m_downloads[id]->resume();
|
m_downloads[id]->resume();
|
||||||
}
|
}
|
||||||
emit managerModel->resumeDownload(index);
|
managerModel->triggerDataUpdateAt(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentManager::cancelBook(const QString& id)
|
void ContentManager::cancelBook(const QString& id)
|
||||||
|
@ -211,8 +211,7 @@ void ContentManagerModel::updateImage(QString bookId, QString url, QByteArray im
|
|||||||
const auto item = getRowNode(row);
|
const auto item = getRowNode(row);
|
||||||
item->setIconData(imageData);
|
item->setIconData(imageData);
|
||||||
m_iconMap[url] = imageData;
|
m_iconMap[url] = imageData;
|
||||||
const QModelIndex index = this->index(row, 0);
|
triggerDataUpdateAt( this->index(row, 0) );
|
||||||
emit dataChanged(index, index);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContentManagerModel::updateDownload(QString bookId)
|
void ContentManagerModel::updateDownload(QString bookId)
|
||||||
@ -221,18 +220,11 @@ void ContentManagerModel::updateDownload(QString bookId)
|
|||||||
|
|
||||||
if ( it != bookIdToRowMap.constEnd() ) {
|
if ( it != bookIdToRowMap.constEnd() ) {
|
||||||
const size_t row = it.value();
|
const size_t row = it.value();
|
||||||
const QModelIndex newIndex = this->index(row, 5);
|
triggerDataUpdateAt( this->index(row, 5) );
|
||||||
emit dataChanged(newIndex, newIndex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ContentManagerModel::triggerDataUpdateAt(QModelIndex index)
|
||||||
void ContentManagerModel::pauseDownload(QModelIndex index)
|
|
||||||
{
|
|
||||||
emit dataChanged(index, index);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ContentManagerModel::resumeDownload(QModelIndex index)
|
|
||||||
{
|
{
|
||||||
emit dataChanged(index, index);
|
emit dataChanged(index, index);
|
||||||
}
|
}
|
||||||
@ -245,7 +237,6 @@ void ContentManagerModel::removeDownload(QString bookId)
|
|||||||
|
|
||||||
const size_t row = it.value();
|
const size_t row = it.value();
|
||||||
getRowNode(row)->setDownloadState(nullptr);
|
getRowNode(row)->setDownloadState(nullptr);
|
||||||
const QModelIndex index = this->index(row, 5);
|
triggerDataUpdateAt( this->index(row, 5) );
|
||||||
emit dataChanged(index, index);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,8 +45,7 @@ public: // functions
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateImage(QString bookId, QString url, QByteArray imageData);
|
void updateImage(QString bookId, QString url, QByteArray imageData);
|
||||||
void pauseDownload(QModelIndex index);
|
void triggerDataUpdateAt(QModelIndex index);
|
||||||
void resumeDownload(QModelIndex index);
|
|
||||||
void removeDownload(QString bookId);
|
void removeDownload(QString bookId);
|
||||||
void updateDownload(QString bookId);
|
void updateDownload(QString bookId);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user