@@ -22,6 +22,31 @@ import "../Components/ListItems" as ListItems
2222LensView {
2323 id: lensView
2424
25+ //FIXME: a quick hack to get icons out of gicons and fallback to
26+ //base icon for annotated icons. Doesn't correctly handle all icons.
27+ //Proper global solution needed.
28+ function from_gicon(name) {
29+ var icon_name = name;
30+ var annotated_re = /^. UnityProtocolAnnotatedIcon/;
31+ if (annotated_re.test(name)) {
32+ var base_icon_re = /'base-icon':.+?'(.+?)'/;
33+ var base_icon = name.toString().match(base_icon_re);
34+ icon_name = base_icon[1];
35+ }
36+ else {
37+ var themed_re = /^. GThemedIcon\s*([^\s]+)\s*/;
38+ var themed = name.match(themed_re);
39+ if (themed) {
40+ return "image://gicon/" + themed[1];
41+ }
42+ }
43+ var remote_re = /^http/;
44+ if (remote_re.test(icon_name)) {
45+ return icon_name;
46+ }
47+ return "image://gicon/" + icon_name;
48+ }
49+
2550 onIsCurrentChanged: {
2651 pageHeader.resetSearch();
2752 }
@@ -74,7 +99,7 @@ LensView {
7499 text: column_5 ? column_5 : "" // FIXME: this shouldn't be necessary
75100 imageWidth: units.gu(11)
76101 imageHeight: units.gu(16)
77− source: column_1 ? column_1 : "" // FIXME: ditto
102+ source: column_1 ? from_gicon(column_1) : "" // FIXME: ditto
78103 }
79104 }
80105 }