LibGUI: Print error when failing to load thumbnail in FileSystemModel

If a thumbnail cannot load it's a good opportunity to print out the
error message.
On top of that, we still want to update m_thumbnail_progress so that
the progress bar doesn't get stuck instead of returning early from
the lambda.
This commit is contained in:
Marcus Nilsson 2022-01-12 18:02:11 +01:00 committed by Andreas Kling
parent 263348ff2d
commit a0ba21e442
Notes: sideshowbarker 2024-07-17 21:02:17 +09:00

View file

@ -657,9 +657,10 @@ bool FileSystemModel::fetch_thumbnail_for(Node const& node)
[this, path, weak_this](auto thumbnail_or_error) {
if (thumbnail_or_error.is_error()) {
s_thumbnail_cache.set(path, nullptr);
return;
dbgln("Failed to load thumbnail for {}: {}", path, thumbnail_or_error.error());
} else {
s_thumbnail_cache.set(path, thumbnail_or_error.release_value());
}
s_thumbnail_cache.set(path, thumbnail_or_error.release_value());
// The model was destroyed, no need to update
// progress or call any event handlers.