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/actionGroups/devicesGroup.vala | 12 ++---------- src/actionGroups/menuGroup.vala | 15 ++++----------- 2 files changed, 6 insertions(+), 21 deletions(-) (limited to 'src/actionGroups') diff --git a/src/actionGroups/devicesGroup.vala b/src/actionGroups/devicesGroup.vala index dee6a6e..d3892fe 100644 --- a/src/actionGroups/devicesGroup.vala +++ b/src/actionGroups/devicesGroup.vala @@ -87,17 +87,9 @@ public class DevicesGroup : ActionGroup { // add all other devices foreach(var mount in this.monitor.get_mounts()) { // get icon - var icon_names = mount.get_icon().to_string().split(" "); + var icon = mount.get_icon(); - string icon = ""; - foreach (var icon_name in icon_names) { - if (Gtk.IconTheme.get_default().has_icon(icon_name)) { - icon = icon_name; - break; - } - } - - this.add_action(new UriAction(mount.get_name(), icon, mount.get_root().get_uri())); + this.add_action(new UriAction(mount.get_name(), Icon.get_icon_name(icon), mount.get_root().get_uri())); } } diff --git a/src/actionGroups/menuGroup.vala b/src/actionGroups/menuGroup.vala index 247376d..26a2662 100644 --- a/src/actionGroups/menuGroup.vala +++ b/src/actionGroups/menuGroup.vala @@ -131,18 +131,11 @@ public class MenuGroup : ActionGroup { if (type == GMenu.TreeItemType.DIRECTORY && !item.get_directory().get_is_nodisplay()) { // create a MenuGroup for sub menus - string[] icons = item.get_directory().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; - } - } - - var sub_menu = PieManager.create_dynamic_pie(item.get_directory().get_name(), final_icon); + // get icon + var icon = item.get_directory().get_icon(); + + var sub_menu = PieManager.create_dynamic_pie(item.get_directory().get_name(), Icon.get_icon_name(icon)); var group = new MenuGroup.sub_menu(sub_menu.id); group.add_action(new PieAction(parent_id, true)); group.load_contents(item.get_directory(), sub_menu.id); -- cgit v1.2.3