[nautilus/wip/antoniof/reimagine-emblems: 2/3] file: Remove remaining GEmblemedIcon support
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/reimagine-emblems: 2/3] file: Remove remaining GEmblemedIcon support
- Date: Fri, 1 Jul 2022 13:58:38 +0000 (UTC)
commit 76b9a8391ecc1ad3e6af6fcf81d99b45932eb1a8
Author: António Fernandes <antoniof gnome org>
Date: Fri Jul 1 14:52:58 2022 +0100
file: Remove remaining GEmblemedIcon support
Emblemed icons are not implemented in GTK 4 and we don't want to
reimplement them here anyway, so let's drop this code.
src/nautilus-file.c | 62 +-----------------------------------------------
src/nautilus-file.h | 3 ---
src/nautilus-grid-cell.c | 4 +---
src/nautilus-name-cell.c | 4 +---
4 files changed, 3 insertions(+), 70 deletions(-)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 5bdc0e125..35538c96c 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -5032,53 +5032,6 @@ prepend_icon_name (const char *name,
g_themed_icon_prepend_name (icon, name);
}
-static void
-apply_emblems_to_icon (NautilusFile *file,
- GIcon **icon,
- NautilusFileIconFlags flags)
-{
-#if 0 && EMBLEMS_NEEDS_GTK4_REIMPLEMENTATION
- GIcon *emblemed_icon = NULL;
-
- g_autolist (GIcon) emblems = NULL;
-
- emblems = nautilus_file_get_emblem_icons (file);
-
- for (GList *l = emblems; l != NULL; l = l->next)
- {
- g_autoptr (GEmblem) emblem = NULL;
-
- if (g_icon_equal (l->data, *icon))
- {
- continue;
- }
-
- emblem = g_emblem_new (l->data);
-
- if (emblemed_icon == NULL)
- {
- emblemed_icon = g_emblemed_icon_new (*icon, emblem);
- }
- else
- {
- g_emblemed_icon_add_emblem (G_EMBLEMED_ICON (emblemed_icon), emblem);
- }
-
- if (emblemed_icon != NULL &&
- (flags & NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM))
- {
- break;
- }
- }
-
- if (emblemed_icon != NULL)
- {
- g_object_unref (*icon);
- *icon = emblemed_icon;
- }
-#endif
-}
-
GIcon *
nautilus_file_get_gicon (NautilusFile *file,
NautilusFileIconFlags flags)
@@ -5117,8 +5070,7 @@ nautilus_file_get_gicon (NautilusFile *file,
if (((flags & NAUTILUS_FILE_ICON_FLAGS_FOR_DRAG_ACCEPT) ||
(flags & NAUTILUS_FILE_ICON_FLAGS_FOR_OPEN_FOLDER) ||
- (flags & NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON) ||
- (flags & NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS)) &&
+ (flags & NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON)) &&
G_IS_THEMED_ICON (file->details->icon))
{
names = g_themed_icon_get_names (G_THEMED_ICON (file->details->icon));
@@ -5179,11 +5131,6 @@ out:
icon = g_object_ref (get_default_file_icon ());
}
- if (flags & NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS)
- {
- apply_emblems_to_icon (file, &icon, flags);
- }
-
return icon;
}
@@ -5290,8 +5237,6 @@ nautilus_file_get_thumbnail_icon (NautilusFile *file,
if (gicon != NULL)
{
- apply_emblems_to_icon (file, &gicon, flags);
-
if (g_icon_equal (gicon, G_ICON (pixbuf)))
{
icon = nautilus_icon_info_new_for_pixbuf (pixbuf, scale);
@@ -5342,11 +5287,6 @@ nautilus_file_get_icon (NautilusFile *file,
gicon = get_custom_icon (file);
if (gicon != NULL)
{
- if (flags & NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS)
- {
- apply_emblems_to_icon (file, &gicon, flags);
- }
-
icon = nautilus_icon_info_lookup (gicon, size, scale);
g_object_unref (gicon);
diff --git a/src/nautilus-file.h b/src/nautilus-file.h
index 713ef7349..4d8b3aecd 100644
--- a/src/nautilus-file.h
+++ b/src/nautilus-file.h
@@ -87,9 +87,6 @@ typedef enum {
NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE = (1<<4),
/* uses the icon of the mount if present */
NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON = (1<<5),
- /* render emblems */
- NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS = (1<<6),
- NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM = (1<<7)
} NautilusFileIconFlags;
#define NAUTILUS_THUMBNAIL_MINIMUM_ICON_SIZE 32
diff --git a/src/nautilus-grid-cell.c b/src/nautilus-grid-cell.c
index 28fc43622..5e36d352d 100644
--- a/src/nautilus-grid-cell.c
+++ b/src/nautilus-grid-cell.c
@@ -43,9 +43,7 @@ update_icon (NautilusGridCell *self)
file = nautilus_view_item_get_file (item);
icon_size = nautilus_view_item_get_icon_size (item);
flags = NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS |
- NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE |
- NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS |
- NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM;
+ NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE;
g_object_get (item, "drag-accept", &drag_accept, NULL);
if (drag_accept)
diff --git a/src/nautilus-name-cell.c b/src/nautilus-name-cell.c
index 55574cb0a..397693cdb 100644
--- a/src/nautilus-name-cell.c
+++ b/src/nautilus-name-cell.c
@@ -149,9 +149,7 @@ update_icon (NautilusNameCell *self)
file = nautilus_view_item_get_file (item);
icon_size = nautilus_view_item_get_icon_size (item);
flags = NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS |
- NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE |
- NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS |
- NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM;
+ NAUTILUS_FILE_ICON_FLAGS_FORCE_THUMBNAIL_SIZE;
g_object_get (item, "drag-accept", &drag_accept, NULL);
if (drag_accept)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]