summaryrefslogtreecommitdiff
path: root/gtk/gtkicontheme.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkicontheme.c')
-rw-r--r--gtk/gtkicontheme.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 65459be8e3..5c4ce8160c 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -3130,7 +3130,28 @@ gtk_icon_paintable_get_filename (GtkIconPaintable *icon)
{
g_return_val_if_fail (icon != NULL, NULL);
- return icon->filename;
+ if (!icon->is_resource)
+ return icon->filename;
+ return NULL;
+}
+
+/**
+ * gtk_icon_paintable_get_resource_path:
+ * @self: a #GtkIcon
+ *
+ * Gets the resource path for the icon.
+ *
+ * Returns: (nullable) (type filename): the resource for the icon, or %NULL
+ * if the icon is not represented by a resource.
+ */
+const gchar *
+gtk_icon_paintable_get_resource_path (GtkIconPaintable *icon)
+{
+ g_return_val_if_fail (icon != NULL, NULL);
+
+ if (icon->is_resource)
+ return icon->filename;
+ return NULL;
}
/**