1
0
mirror of https://gitlab.gnome.org/GNOME/nautilus synced 2024-06-30 23:46:35 +00:00

bookmark: Don't mark non-native bookmarks as broken

We want to use a warning icon to warn about broken bookmarks,
i.e., bookmarks whose pointed path is gone.

But for non-local files, this may just mean they are not currently
mounted or temporarily innaccessible, not necessarily broken.

So, apply the broken bookmark icon logic to native icons only.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/merge_requests/1430#note_2069827
This commit is contained in:
António Fernandes 2024-05-22 12:44:54 +01:00
parent a011010567
commit 356570978c

View File

@ -218,6 +218,12 @@ static GIcon *
get_native_icon (NautilusBookmark *bookmark,
gboolean symbolic)
{
if (!bookmark->exists)
{
g_debug ("%s: file does not exist, set warning icon", nautilus_bookmark_get_name (bookmark));
return g_themed_icon_new (symbolic ? "dialog-warning-symbolic" : "dialog-warning");
}
GUserDirectory xdg_type;
if (nautilus_bookmark_get_xdg_type (bookmark, &xdg_type))
@ -241,13 +247,7 @@ nautilus_bookmark_set_icon_to_default (NautilusBookmark *bookmark)
g_autoptr (GIcon) icon = NULL;
g_autoptr (GIcon) symbolic_icon = NULL;
if (!bookmark->exists)
{
g_debug ("%s: file does not exist, set warning icon", nautilus_bookmark_get_name (bookmark));
symbolic_icon = g_themed_icon_new ("dialog-warning-symbolic");
icon = g_themed_icon_new ("dialog-warning");
}
else if (g_file_is_native (bookmark->location))
if (g_file_is_native (bookmark->location))
{
symbolic_icon = get_native_icon (bookmark, TRUE);
icon = get_native_icon (bookmark, FALSE);