diff options
author | António Fernandes <antoniof@gnome.org> | 2022-07-01 13:44:41 +0100 |
---|---|---|
committer | António Fernandes <antoniojpfernandes@gmail.com> | 2022-07-02 18:43:50 +0000 |
commit | f8998e1624bc80021557a2ce908525e33a89afd9 (patch) | |
tree | cd0cab465ae6f3167a3a1db40485903df3105ef9 | |
parent | f9a7cdb1ecb402a4f4edff9ca7f31590bf68a3ca (diff) | |
download | nautilus-f8998e1624bc80021557a2ce908525e33a89afd9.tar.gz |
bookmark: Simplify broken bookmark icon logic
There is no need to restore emblem functionlity here, because a warning
icon works just fine. Let's cleanup.
-rw-r--r-- | src/nautilus-bookmark.c | 46 |
1 files changed, 7 insertions, 39 deletions
diff --git a/src/nautilus-bookmark.c b/src/nautilus-bookmark.c index ba56a97e5..f016eee37 100644 --- a/src/nautilus-bookmark.c +++ b/src/nautilus-bookmark.c @@ -168,36 +168,6 @@ bookmark_file_changed_callback (NautilusFile *file, } } -static void -apply_warning_emblem (GIcon **base, - gboolean symbolic) -{ -#if 0 && EMBLEMS_NEEDS_GTK4_REIMPLEMENTATION - GIcon *emblemed_icon; - g_autoptr (GIcon) warning = NULL; - g_autoptr (GEmblem) emblem = NULL; - - if (symbolic) - { - warning = g_themed_icon_new ("dialog-warning-symbolic"); - } - else - { - warning = g_themed_icon_new ("dialog-warning"); - } - - emblem = g_emblem_new (warning); - emblemed_icon = g_emblemed_icon_new (*base, emblem); - - g_object_unref (*base); - - *base = emblemed_icon; -#else - /* GTK 4 doesn't draw emblemed icons. Use the warning icon itself. */ - g_set_object (base, g_themed_icon_new (symbolic ? "dialog-warning-symbolic" : "dialog-warning")); -#endif -} - gboolean nautilus_bookmark_get_is_builtin (NautilusBookmark *bookmark) { @@ -303,7 +273,13 @@ nautilus_bookmark_set_icon_to_default (NautilusBookmark *bookmark) g_autoptr (GIcon) icon = NULL; g_autoptr (GIcon) symbolic_icon = NULL; - if (g_file_is_native (bookmark->location)) + if (!bookmark->exists) + { + 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)) { symbolic_icon = get_native_icon (bookmark, TRUE); icon = get_native_icon (bookmark, FALSE); @@ -314,14 +290,6 @@ nautilus_bookmark_set_icon_to_default (NautilusBookmark *bookmark) icon = g_themed_icon_new (NAUTILUS_ICON_FULLCOLOR_FOLDER_REMOTE); } - if (!bookmark->exists) - { - DEBUG ("%s: file does not exist, add emblem", nautilus_bookmark_get_name (bookmark)); - - apply_warning_emblem (&icon, FALSE); - apply_warning_emblem (&symbolic_icon, TRUE); - } - DEBUG ("%s: setting icon to default", nautilus_bookmark_get_name (bookmark)); g_object_set (bookmark, |