Screenshots: clear the thumbnailing pool on page delete

Removes pending QThreadPool jobs which linger after page delete.
May help with #1201 by allowing the pool to finish earlier.

Signed-off-by: James Beddek <telans@posteo.de>
This commit is contained in:
James Beddek 2023-06-20 16:54:15 +12:00
parent d9b24f7705
commit f2471f0f68
No known key found for this signature in database
GPG Key ID: 0B4F753DA83DBA90

View File

@ -146,7 +146,11 @@ public:
m_thumbnailCache->add("placeholder", APPLICATION->getThemedIcon("screenshot-placeholder"));
connect(&watcher, SIGNAL(fileChanged(QString)), SLOT(fileChanged(QString)));
}
virtual ~FilterModel() { m_thumbnailingPool.waitForDone(500); }
virtual ~FilterModel() {
m_thumbnailingPool.clear();
if (!m_thumbnailingPool.waitForDone(500))
qDebug() << "Thumbnail pool took longer than 500ms to finish";
}
virtual QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const
{
auto model = sourceModel();