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 | |
parent | 75655ffca55cb5e5ca51d8f6a4d3d600f1f54cdc (diff) | |
parent | 98f3ef2689de06e8ab8b46a91acfa7dd2056a3a6 (diff) |
Merge tag 'upstream/0.5.1'
Upstream version 0.5.1
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/actionRegistry.vala | 27 | ||||
-rw-r--r-- | src/actions/pieAction.vala | 10 |
2 files changed, 13 insertions, 24 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()); } ///////////////////////////////////////////////////////////////////// diff --git a/src/actions/pieAction.vala b/src/actions/pieAction.vala index 5b2c81d..faf7aca 100644 --- a/src/actions/pieAction.vala +++ b/src/actions/pieAction.vala @@ -58,13 +58,17 @@ public class PieAction : Action { public override string name { get { var referee = PieManager.all_pies[real_command]; - if (referee != null) - return referee.name; + if (referee != null) { + owned_name = "↪" + referee.name; + return owned_name; + } return ""; } protected set {} } + private string owned_name; + ///////////////////////////////////////////////////////////////////// /// Returns the icon of the referenced Pie. ///////////////////////////////////////////////////////////////////// @@ -92,7 +96,7 @@ public class PieAction : Action { ///////////////////////////////////////////////////////////////////// public override void activate() { - PieManager.open_pie(real_command); + PieManager.open_pie(real_command, true); } } |