From 20a70ced55c1b91366d4dde3ba4e6eac015d734e Mon Sep 17 00:00:00 2001 From: Dennis Tomas Date: Wed, 18 Jul 2007 20:20:36 +0200 Subject: [PATCH] Use Name entry of .desktop files for pinboard/panel icons. --- ROX-Filer/src/icon.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/ROX-Filer/src/icon.c b/ROX-Filer/src/icon.c index e70465be..a8b4c318 100644 --- a/ROX-Filer/src/icon.c +++ b/ROX-Filer/src/icon.c @@ -443,11 +443,30 @@ void icon_set_path(Icon *icon, const char *pathname, const char *name) icon_hash_path(icon); - if (!name) - name = g_basename(icon->src_path); - - icon->item = diritem_new(name); + icon->item = diritem_new(""); diritem_restat(icon->path, icon->item, NULL); + + g_free(icon->item->leafname); + icon->item->leafname = NULL; + + if (name) + icon->item->leafname = g_strdup(name); + else + { + if (icon->item->mime_type == application_x_desktop) + { + GError *error = NULL; + icon->item->leafname = get_value_from_desktop_file(icon->src_path, + "Desktop Entry", + "Name", + &error); + if (error) + g_error_free(error); + } + } + + if (icon->item->leafname == NULL) + icon->item->leafname = g_strdup(g_basename(icon->src_path)); } } -- 2.11.4.GIT