summaryrefslogtreecommitdiff
path: root/src/actions/actionRegistry.vala
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/actions/actionRegistry.vala
parenta824c3e5bdab686901b02667609282e7d596a6af (diff)
Imported Upstream version 0.5.1
Diffstat (limited to 'src/actions/actionRegistry.vala')
-rw-r--r--src/actions/actionRegistry.vala27
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());
}
/////////////////////////////////////////////////////////////////////