From 98f3ef2689de06e8ab8b46a91acfa7dd2056a3a6 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Mon, 5 Mar 2012 12:19:59 +0100 Subject: Imported Upstream version 0.5.1 --- src/actions/actionRegistry.vala | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'src/actions/actionRegistry.vala') diff --git a/src/actions/actionRegistry.vala b/src/actions/actionRegistry.vala index 135e90c..705c06c 100644 --- a/src/actions/actionRegistry.vala +++ b/src/actions/actionRegistry.vala @@ -137,15 +137,8 @@ public class ActionRegistry : GLib.Object { return new_for_desktop_file(file.get_parse_name()); // search for an appropriate icon - var gicon = info.get_icon(); - string[] icons = gicon.to_string().split(" "); - - foreach (var icon in icons) { - if (Gtk.IconTheme.get_default().has_icon(icon)) { - final_icon = icon; - break; - } - } + var icon = info.get_icon(); + final_icon = Icon.get_icon_name(icon); } catch (GLib.Error e) { warning(e.message); @@ -167,19 +160,11 @@ public class ActionRegistry : GLib.Object { /// A helper method which creates an AppAction for given AppInfo. ///////////////////////////////////////////////////////////////////// - public static Action? new_for_app_info(GLib.AppInfo info) { - string[] icons = info.get_icon().to_string().split(" "); - string final_icon = "application-default-icon"; - - // search for available icons - foreach (var icon in icons) { - if (Gtk.IconTheme.get_default().has_icon(icon)) { - final_icon = icon; - break; - } - } + public static Action? new_for_app_info(GLib.AppInfo info) { + // get icon + var icon = info.get_icon(); - return new AppAction(info.get_display_name() , final_icon, info.get_commandline()); + return new AppAction(info.get_display_name(), Icon.get_icon_name(icon), info.get_commandline()); } ///////////////////////////////////////////////////////////////////// -- cgit v1.2.3