diff options
author | Alessandro Ghedini <al3xbio@gmail.com> | 2012-03-05 12:20:00 +0100 |
---|---|---|
committer | Alessandro Ghedini <al3xbio@gmail.com> | 2012-03-05 12:20:00 +0100 |
commit | 9efffcc071e59e6c0fe5d0b406e558cc7319e8ee (patch) | |
tree | 1f4d8d555dc439403da78c52e413be3c29833c21 /src/actions/actionRegistry.vala | |
parent | 75655ffca55cb5e5ca51d8f6a4d3d600f1f54cdc (diff) | |
parent | 98f3ef2689de06e8ab8b46a91acfa7dd2056a3a6 (diff) |
Merge tag 'upstream/0.5.1'
Upstream version 0.5.1
Diffstat (limited to 'src/actions/actionRegistry.vala')
-rw-r--r-- | src/actions/actionRegistry.vala | 27 |
1 files changed, 6 insertions, 21 deletions
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()); } ///////////////////////////////////////////////////////////////////// |