From: Raul Gutierrez Segales Date: Wed, 26 Oct 2011 14:26:07 +0000 (+0100) Subject: e-d-s: load icon regardless of the mime type being available X-Git-Tag: FOLKS_0_6_5~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa50fcfa896f9102411f1f5b6772e17129f1decc;p=platform%2Fupstream%2Ffolks.git e-d-s: load icon regardless of the mime type being available Also, allow Edsf.MemoryIcon to be instantiated with a null image type. The notion of the image type not being available was half there (some comments mentioned the possibility), but it wasn't contemplated in the constructor and in the instance variable. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=662770 --- diff --git a/NEWS b/NEWS index 62c1609..198891e 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ Bugs fixed: * Bug 662433 — AbstractFieldDetails.equal() is ambiguous about checking parameters. * Bug 660908 — Add favourites support to EDS backend +* Bug 662770 — ContactPhotos are ignored when mime type is null API changes: * Add AbstractFieldDetails.id to identify instances of details diff --git a/backends/eds/lib/edsf-persona.vala b/backends/eds/lib/edsf-persona.vala index a7bcaf4..e316591 100644 --- a/backends/eds/lib/edsf-persona.vala +++ b/backends/eds/lib/edsf-persona.vala @@ -1167,7 +1167,7 @@ public class Edsf.Persona : Folks.Persona, return new FileIcon (File.new_for_uri (p.get_uri ())); case ContactPhotoType.INLINED: - if (p.get_mime_type () == null || p.get_inlined () == null) + if (p.get_inlined () == null) { return null; } diff --git a/backends/eds/lib/memory-icon.vala b/backends/eds/lib/memory-icon.vala index 360f541..544339f 100644 --- a/backends/eds/lib/memory-icon.vala +++ b/backends/eds/lib/memory-icon.vala @@ -30,7 +30,7 @@ using GLib; internal class Edsf.MemoryIcon : Object, Icon, LoadableIcon { private uint8[] _image_data; - private string _image_type; + private string? _image_type; /** * Construct a new in-memory icon. @@ -39,7 +39,7 @@ internal class Edsf.MemoryIcon : Object, Icon, LoadableIcon * @param image_data the binary data of the image * @since 0.6.0 */ - public MemoryIcon (string image_type, uint8[] image_data) + public MemoryIcon (string? image_type, uint8[] image_data) { this._image_data = image_data; this._image_type = image_type; @@ -83,7 +83,7 @@ internal class Edsf.MemoryIcon : Object, Icon, LoadableIcon * * Basically, this is just a nul-safe version of g_str_hash(). Which is * calculated over both the image type and image data. */ - uint hash = this._image_type.hash (); + uint hash = this._image_type != null ? this._image_type.hash () : 0; for (uint i = 0; i < this._image_data.length; i++) {