summaryrefslogtreecommitdiff
path: root/src/actionGroups
diff options
context:
space:
mode:
authorAlessandro Ghedini <al3xbio@gmail.com>2012-03-05 12:19:59 +0100
committerAlessandro Ghedini <al3xbio@gmail.com>2012-03-05 12:19:59 +0100
commit98f3ef2689de06e8ab8b46a91acfa7dd2056a3a6 (patch)
treeb98e438ac1082925e12af6dfec6d9ebeb4e3035e /src/actionGroups
parenta824c3e5bdab686901b02667609282e7d596a6af (diff)
Imported Upstream version 0.5.1
Diffstat (limited to 'src/actionGroups')
-rw-r--r--src/actionGroups/devicesGroup.vala12
-rw-r--r--src/actionGroups/menuGroup.vala15
2 files changed, 6 insertions, 21 deletions
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);