From 6cc8aba9bb7a7720586144b7066bc7ab115afd6e Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Mon, 18 Jan 1999 20:07:27 +0000 Subject: [PATCH] 4.5.8 release --- configure.in | 2 +- gnome/gicon.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index f509fa90e..f0b66f01e 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_INIT(create_vcs) AC_CONFIG_HEADER(config.h) PACKAGE=mc -VERSION=4.5.6 +VERSION=4.5.8 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_SUBST(VERSION) diff --git a/gnome/gicon.c b/gnome/gicon.c index 16b52cc38..c7d64653e 100644 --- a/gnome/gicon.c +++ b/gnome/gicon.c @@ -291,3 +291,36 @@ gicon_get_icon_for_file (file_entry *fe) { return gicon_get_icon_for_file_speed (fe, TRUE); } + +typedef lookup_name_closure_t { + char *name; + void *image; +}; + +void +search_image (gpointer key, gpointer value, gpointer user_data) +{ + lookup_name_closure_t *closure = user_data; + + if (value == closure->image) + closure->name = key; +} + +/** + * Returns the file name that maps to this given GdkImlibImage + * + */ +char * +gicon_image_to_name (GdkImlibImage *image) +{ + lookup_name_closure_t closure; + + closure.image = image; + closure.name = NULL; + + g_hash_table_foreach (icon_hash, check_key, &search_image, &closure); + if (closure.name == NULL) + return g_strdup (ICONDIR "i-regular.png"); + + return g_strdup (closure.name); +}