@@ -18,35 +18,11 @@ import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import "../Components"
19import "../Components"
20import "../Components/ListItems" as ListItems
20import "../Components/ListItems" as ListItems
21+import "../Components/IconUtil.js" as IconUtil
23 id: lensView
24 id: lensView
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];
37− var themed_re = /^. GThemedIcon\s*([^\s]+)\s*/;
38− var themed = name.match(themed_re);
40− return "image://gicon/" + themed[1];
43− var remote_re = /^http/;
44− if (remote_re.test(icon_name)) {
47− return "image://gicon/" + icon_name;
50 onIsCurrentChanged: {
26 onIsCurrentChanged: {
51 pageHeader.resetSearch();
27 pageHeader.resetSearch();
@@ -99,7 +75,7 @@ LensView {
99 text: column_5 ? column_5 : "" // FIXME: this shouldn't be necessary
75 text: column_5 ? column_5 : "" // FIXME: this shouldn't be necessary
100 imageWidth: units.gu(11)
76 imageWidth: units.gu(11)
101 imageHeight: units.gu(16)
77 imageHeight: units.gu(16)
102− source: column_1 ? from_gicon(column_1) : "" // FIXME: ditto
78+ source: column_1 ? IconUtil.from_gicon(column_1) : "" // FIXME: ditto