[gnome-shell] Remove _for_theme() variant of st_texture_cache_load_icon_name()



commit dc1e23501c14e4e6bf40c206d1e1f8e9dcc255d3
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Fri Nov 12 17:07:05 2010 -0500

    Remove _for_theme() variant of st_texture_cache_load_icon_name()
    
    Now that we're using St.Icon in the Javascript, there is no reason
    to have separate st_texture_cache_load_icon_name() and
    st_texture_cache_load_icon_name_for_theme(), instead just add
    the StThemeNode argument to st_texture_cache_load_icon_name().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=633866

 src/st/st-icon.c          |   10 +++++-----
 src/st/st-texture-cache.c |   45 +++++++++++----------------------------------
 src/st/st-texture-cache.h |    7 +------
 3 files changed, 17 insertions(+), 45 deletions(-)
---
diff --git a/src/st/st-icon.c b/src/st/st-icon.c
index bd7e9eb..94e6842 100644
--- a/src/st/st-icon.c
+++ b/src/st/st-icon.c
@@ -324,11 +324,11 @@ st_icon_update (StIcon *icon)
       if (theme_node)
         {
           StTextureCache *cache = st_texture_cache_get_default ();
-          priv->icon_texture = st_texture_cache_load_icon_name_for_theme (cache,
-                                                                          theme_node,
-                                                                          priv->icon_name,
-                                                                          priv->icon_type,
-                                                                          priv->icon_size);
+          priv->icon_texture = st_texture_cache_load_icon_name (cache,
+                                                                theme_node,
+                                                                priv->icon_name,
+                                                                priv->icon_type,
+                                                                priv->icon_size);
 
           if (priv->icon_texture)
             clutter_actor_set_parent (priv->icon_texture, CLUTTER_ACTOR (icon));
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index 9d61129..cdea848 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -1235,9 +1235,9 @@ st_texture_cache_load_sliced_image (StTextureCache    *cache,
  */
 
 /**
- * st_texture_cache_load_icon_name_for_theme:
+ * st_texture_cache_load_icon_name:
  * @cache: The texture cache instance
- * @theme_node: a #StThemeNode
+ * @theme_node: (allow-none): a #StThemeNode
  * @name: Name of a themed icon
  * @icon_type: the type of icon to load
  * @size: Size of themed
@@ -1249,16 +1249,18 @@ st_texture_cache_load_sliced_image (StTextureCache    *cache,
  * Return Value: (transfer none): A new #ClutterTexture for the icon
  */
 ClutterActor *
-st_texture_cache_load_icon_name_for_theme (StTextureCache    *cache,
-                                           StThemeNode       *theme_node,
-                                           const char        *name,
-                                           StIconType         icon_type,
-                                           gint               size)
+st_texture_cache_load_icon_name (StTextureCache    *cache,
+                                 StThemeNode       *theme_node,
+                                 const char        *name,
+                                 StIconType         icon_type,
+                                 gint               size)
 {
   ClutterActor *texture;
   GIcon *themed;
   char *symbolic;
 
+  g_return_val_if_fail (!(icon_type == ST_ICON_SYMBOLIC && theme_node == NULL), NULL);
+
   switch (icon_type)
     {
     case ST_ICON_APPLICATION:
@@ -1273,12 +1275,8 @@ st_texture_cache_load_icon_name_for_theme (StTextureCache    *cache,
       symbolic = g_strconcat (name, "-symbolic", NULL);
       themed = g_themed_icon_new_with_default_fallbacks ((const gchar*)symbolic);
       g_free (symbolic);
-      if (theme_node)
-        texture = load_gicon_with_colors (cache, themed, size,
-                                          st_theme_node_get_icon_colors (theme_node));
-      else
-        texture = st_texture_cache_load_gicon (cache, themed, size);
-
+      texture = load_gicon_with_colors (cache, themed, size,
+                                        st_theme_node_get_icon_colors (theme_node));
       g_object_unref (themed);
 
       return CLUTTER_ACTOR (texture);
@@ -1295,27 +1293,6 @@ st_texture_cache_load_icon_name_for_theme (StTextureCache    *cache,
 }
 
 /**
- * st_texture_cache_load_icon_name:
- * @cache: The texture cache instance
- * @name: Name of a themed icon
- * @icon_type: the type of icon to load
- * @size: Size of themed
- *
- * Load a themed icon into a texture. See the #StIconType documentation
- * for an explanation of how @icon_type affects the returned icon.
- *
- * Return Value: (transfer none): A new #ClutterTexture for the icon
- */
-ClutterActor *
-st_texture_cache_load_icon_name (StTextureCache    *cache,
-                                 const char        *name,
-                                 StIconType         icon_type,
-                                 gint               size)
-{
-  return st_texture_cache_load_icon_name_for_theme (cache, NULL, name, icon_type, size);
-}
-
-/**
  * st_texture_cache_load_uri_async:
  *
  * @cache: The texture cache instance
diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h
index 80b3060..e8fc586 100644
--- a/src/st/st-texture-cache.h
+++ b/src/st/st-texture-cache.h
@@ -79,16 +79,11 @@ ClutterActor *st_texture_cache_bind_pixbuf_property (StTextureCache    *cache,
                                                      const char        *property_name);
 
 ClutterActor *st_texture_cache_load_icon_name (StTextureCache *cache,
+                                               StThemeNode    *theme_node,
                                                const char     *name,
                                                StIconType      icon_type,
                                                gint            size);
 
-ClutterActor *st_texture_cache_load_icon_name_for_theme (StTextureCache *cache,
-                                                         StThemeNode    *theme_node,
-                                                         const char     *name,
-                                                         StIconType      icon_type,
-                                                         gint            size);
-
 ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
                                            GIcon          *icon,
                                            gint            size);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]