Drop gtk_icon_theme_list_contexts
authorMatthias Clasen <mclasen@redhat.com>
Thu, 17 Oct 2019 21:24:21 +0000 (16:24 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 18 Oct 2019 13:53:23 +0000 (08:53 -0500)
Contexts in icon themes are not useful for anything.

docs/reference/gtk/gtk4-sections.txt
gtk/gtkicontheme.c
gtk/gtkicontheme.h

index 19e6d040b5bfb0fe0751afb58c8153bf4a5239c7..93485b2defebf42a11e3feb20fe32661631e44ce 100644 (file)
@@ -5308,7 +5308,6 @@ gtk_icon_theme_lookup_by_gicon
 gtk_icon_theme_lookup_by_gicon_for_scale
 gtk_icon_theme_load_icon
 gtk_icon_theme_load_icon_for_scale
-gtk_icon_theme_list_contexts
 gtk_icon_theme_list_icons
 gtk_icon_theme_get_icon_sizes
 gtk_icon_theme_get_example_icon_name
index cbb462c0298b5bc63d276b384884a67fdcc5a49a..bf829c25844f82d28d8710b3612b2c04bf646840 100644 (file)
@@ -313,8 +313,6 @@ static void         theme_list_icons          (IconTheme        *theme,
                                                GQuark            context);
 static gboolean     theme_has_icon            (IconTheme        *theme,
                                                const gchar      *icon_name);
-static void         theme_list_contexts       (IconTheme        *theme,
-                                               GHashTable       *contexts);
 static void         theme_subdir_load         (GtkIconTheme     *self,
                                                IconTheme        *theme,
                                                GKeyFile         *theme_file,
@@ -2273,7 +2271,6 @@ add_key_to_list (gpointer key,
  * [Icon Theme Specification](http://www.freedesktop.org/wiki/Specifications/icon-theme-spec).
  * The standard contexts are listed in the
  * [Icon Naming Specification](http://www.freedesktop.org/wiki/Specifications/icon-naming-spec).
- * Also see gtk_icon_theme_list_contexts().
  *
  * Returns: (element-type utf8) (transfer full): a #GList list
  *     holding the names of all the icons in the theme. You must
@@ -2325,47 +2322,6 @@ gtk_icon_theme_list_icons (GtkIconTheme *self,
   return list;
 }
 
-/**
- * gtk_icon_theme_list_contexts:
- * @self: a #GtkIconTheme
- *
- * Gets the list of contexts available within the current
- * hierarchy of icon themes.
- * See gtk_icon_theme_list_icons() for details about contexts.
- *
- * Returns: (element-type utf8) (transfer full): a #GList list
- *     holding the names of all the contexts in the theme. You must first
- *     free each element in the list with g_free(), then free the list
- *     itself with g_list_free().
- */
-GList *
-gtk_icon_theme_list_contexts (GtkIconTheme *self)
-{
-  GHashTable *contexts;
-  GList *list, *l;
-
-  ensure_valid_themes (self);
-
-  contexts = g_hash_table_new (g_str_hash, g_str_equal);
-
-  l = self->themes;
-  while (l != NULL)
-    {
-      theme_list_contexts (l->data, contexts);
-      l = l->next;
-    }
-
-  list = NULL;
-
-  g_hash_table_foreach (contexts,
-                        add_key_to_list,
-                        &list);
-
-  g_hash_table_destroy (contexts);
-
-  return list;
-}
-
 /**
  * gtk_icon_theme_get_example_icon_name:
  * @self: a #GtkIconTheme
@@ -2835,26 +2791,6 @@ theme_has_icon (IconTheme   *theme,
   return FALSE;
 }
 
-static void
-theme_list_contexts (IconTheme  *theme, 
-                     GHashTable *contexts)
-{
-  GList *l = theme->dirs;
-  IconThemeDir *dir;
-  const gchar *context;
-
-  while (l != NULL)
-    {
-      dir = l->data;
-
-      context = g_quark_to_string (dir->context);
-      if (context != NULL)
-        g_hash_table_replace (contexts, (gpointer) context, NULL);
-
-      l = l->next;
-    }
-}
-
 static GHashTable *
 scan_directory (GtkIconTheme  *self,
                 char          *full_dir)
index 18e895d180980774d02797e29bc438ff772b39d0..fbe56bf8a7fc3b5b46ab029fbe2fbace41a808ff 100644 (file)
@@ -199,8 +199,6 @@ GDK_AVAILABLE_IN_ALL
 GList *       gtk_icon_theme_list_icons            (GtkIconTheme                *self,
                                                    const gchar                 *context);
 GDK_AVAILABLE_IN_ALL
-GList *       gtk_icon_theme_list_contexts         (GtkIconTheme                *self);
-GDK_AVAILABLE_IN_ALL
 char *        gtk_icon_theme_get_example_icon_name (GtkIconTheme                *self);
 
 GDK_AVAILABLE_IN_ALL