mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibGUI: Return symlink fallback icon if target icon cannot be determined
This is the case for symlinks that point to themselves, for example - previously the returned icon would be empty. Fixes #5978. Fixes #5979.
This commit is contained in:
parent
9c141d0a87
commit
e8aa998cdc
Notes:
sideshowbarker
2024-07-18 21:01:10 +09:00
Author: https://github.com/linusg
Commit: e8aa998cdc
Pull-request: https://github.com/SerenityOS/serenity/pull/5980
Issue: https://github.com/SerenityOS/serenity/issues/5978
Issue: https://github.com/SerenityOS/serenity/issues/5979
1 changed files with 2 additions and 0 deletions
|
@ -235,6 +235,8 @@ Icon FileIconProvider::icon_for_path(const String& path, mode_t mode)
|
|||
target_path = Core::File::real_path_for(String::formatted("{}/{}", LexicalPath(path).dirname(), raw_symlink_target));
|
||||
}
|
||||
auto target_icon = icon_for_path(target_path);
|
||||
if (target_icon.sizes().is_empty())
|
||||
return s_symlink_icon;
|
||||
|
||||
Icon generated_icon;
|
||||
for (auto size : target_icon.sizes()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue