do not capture by default all values in lambdas

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2024-10-30 17:55:02 +02:00
parent e7ff3146fe
commit 82bffabb69
38 changed files with 170 additions and 186 deletions

View File

@ -337,7 +337,7 @@ std::optional<QIcon> ResourceModel::getIcon(QModelIndex& index, const QUrl& url)
auto icon_fetch_action = Net::ApiDownload::makeCached(url, cache_entry);
auto full_file_path = cache_entry->getFullPath();
connect(icon_fetch_action.get(), &Task::succeeded, this, [=] {
connect(icon_fetch_action.get(), &Task::succeeded, this, [this, url, full_file_path, index] {
auto icon = QIcon(full_file_path);
QPixmapCache::insert(url.toString(), icon.pixmap(icon.actualSize({ 64, 64 })));
@ -345,7 +345,7 @@ std::optional<QIcon> ResourceModel::getIcon(QModelIndex& index, const QUrl& url)
emit dataChanged(index, index, { Qt::DecorationRole });
});
connect(icon_fetch_action.get(), &Task::failed, this, [=] {
connect(icon_fetch_action.get(), &Task::failed, this, [this, url] {
m_currently_running_icon_actions.remove(url);
m_failed_icon_actions.insert(url);
});