Commit 9f790772 authored by Thiago Alvarenga Salvadori's avatar Thiago Alvarenga Salvadori
Browse files

le-search: fix pdf icons not showing in educational content search for some files


Signed-off-by: default avatarThiago Alvarenga Salvadori <thiagoalvarenga3@gmail.com>
parent 4634d957
......@@ -261,20 +261,19 @@ EventItem.prototype = {
this.content = new St.BoxLayout( { style_class: 'contact-content',
vertical: false});
/* octect-stream type behave as a pdf but the following function does not recognize it */
let type = result.type[0] == 'application/octet-stream'? 'application/pdf' : result.type[0];
let iconObj = Gio.app_info_get_default_for_type(result.type[0],null);
let iconObj = Gio.app_info_get_default_for_type(type,null);
if (iconObj) {
if (iconObj) {
iconObj = iconObj.get_icon();
global.log('iconObj: ' + iconObj);
this.icon = St.TextureCache.get_default().load_gicon(null, iconObj, ICON_SIZE);
global.log('this.icon: ' + this.icon);
this.content.add(this.icon, { x_fill: true,
y_fill: false,
x_align: St.Align.START,
y_align: St.Align.MIDDLE });
} else {
global.log('mimetype: ' + result.type[0]);
}
this.details = new St.BoxLayout({ style_class: 'contact-details',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment