diff options
author | Alexander Larsson <alexl@redhat.com> | 2020-02-04 09:35:20 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2020-02-04 09:35:20 +0100 |
commit | 046de4ccbf5cb1e8e4d5b4d854106968d8203d52 (patch) | |
tree | e2a9ebbecee19b42d13df4967017959329b0a4fe /gtk/gtkiconcache.c | |
parent | 308d434b579f95204a215615f00a802c9c7d9dba (diff) | |
download | gtk+-046de4ccbf5cb1e8e4d5b4d854106968d8203d52.tar.gz |
icon-theme: Only have one copy of the icon flags enum
It turns out with the icon cache now using the virtual SYMBOLIC_PNG_SUFFIX
flag the two enums are now identical, so lets just use one of them, the
one GtkIconCache (so we move it to the header).
Diffstat (limited to 'gtk/gtkiconcache.c')
-rw-r--r-- | gtk/gtkiconcache.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/gtk/gtkiconcache.c b/gtk/gtkiconcache.c index 8e4b86d6eb..7c6e6dd247 100644 --- a/gtk/gtkiconcache.c +++ b/gtk/gtkiconcache.c @@ -43,19 +43,6 @@ #define GET_UINT16(cache, offset) (GUINT16_FROM_BE (*(guint16 *)((cache) + (offset)))) #define GET_UINT32(cache, offset) (GUINT32_FROM_BE (*(guint32 *)((cache) + (offset)))) -/* Keep in sync with gtkicontheme.c */ -typedef enum -{ - /* These are used in the file format: */ - ICON_SUFFIX_NONE = 0, - ICON_SUFFIX_XPM = 1 << 0, - ICON_SUFFIX_SVG = 1 << 1, - ICON_SUFFIX_PNG = 1 << 2, - HAS_ICON_FILE = 1 << 3, - /* This is just used by Gtk, so we convert internally to this: */ - ICON_SUFFIX_SYMBOLIC_PNG = 1 << 4 -} IconSuffix; - struct _GtkIconCache { gint ref_count; @@ -255,13 +242,13 @@ gtk_icon_cache_list_icons_in_directory (GtkIconCache *cache, char *converted_name; guint32 hash_flags = 0; - /* Icons named foo.symbolic.png are stored in the cache as "foo.symbolic" with ICON_SUFFIX_PNG, - * but we convert it internally to ICON_SUFFIX_SYMBOLIC_PNG. + /* Icons named foo.symbolic.png are stored in the cache as "foo.symbolic" with ICON_CACHE_FLAG_PNG, + * but we convert it internally to ICON_CACHE_FLAG_SYMBOLIC_PNG. * Otherwise we use the same enum values and names as on disk. */ - if (g_str_has_suffix (name, ".symbolic") && (flags & ICON_SUFFIX_PNG) != 0) + if (g_str_has_suffix (name, ".symbolic") && (flags & ICON_CACHE_FLAG_PNG_SUFFIX) != 0) { - flags |= ICON_SUFFIX_SYMBOLIC_PNG; - flags &= ~ICON_SUFFIX_PNG; + flags |= ICON_CACHE_FLAG_SYMBOLIC_PNG_SUFFIX; + flags &= ~ICON_CACHE_FLAG_PNG_SUFFIX; converted_name = g_strndup (name, strlen(name) - 9); } else |