summaryrefslogtreecommitdiff
path: root/src/images/icon.vala
diff options
context:
space:
mode:
authorAlessandro Ghedini <al3xbio@gmail.com>2012-01-21 19:14:06 +0100
committerAlessandro Ghedini <al3xbio@gmail.com>2012-01-21 19:19:46 +0100
commitc05883f47c498be4e11893e5178c5bc37ffd9f4a (patch)
treedbd3cd7ad3d7771405ad63af2f1e9d14d4ae5a35 /src/images/icon.vala
parent31539042f11bc210a29e923f45586779c3ad46b2 (diff)
parent60560a030fda3c539ff9dc1563b9926414a193da (diff)
Merge commit 'upstream/0.4.0'
Diffstat (limited to 'src/images/icon.vala')
-rw-r--r--src/images/icon.vala12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/images/icon.vala b/src/images/icon.vala
index 1c8a9f4..81eb2d9 100644
--- a/src/images/icon.vala
+++ b/src/images/icon.vala
@@ -80,7 +80,17 @@ public class Icon : Image {
public static string get_icon_file(string icon_name, int size) {
string result = "";
-
+
+ if (icon_name.contains("/")) {
+ var file = GLib.File.new_for_path(icon_name);
+ if(file.query_exists())
+ return icon_name;
+
+ warning("Icon \"" + icon_name + "\" not found! Using default icon...");
+ icon_name = "application-default-icon";
+ }
+
+
var icon_theme = Gtk.IconTheme.get_default();
var file = icon_theme.lookup_icon(icon_name, size, 0);
if (file != null) result = file.get_filename();