[folks] eds: Remove use of the AvatarCache



commit 97474e2016882c616452095312b0922f3045da4a
Author: Philip Withnall <philip tecnocode co uk>
Date:   Wed Aug 13 23:58:41 2014 +0100

    eds: Remove use of the AvatarCache
    
    For several reasons:
     1) Now that only local URIs are permitted for URI-based photos, loading
        the photos should no longer be slow and need caching.
     2) Inline photos don’t need caching (and if they do, it should be in
        EDS, not folks — see bug #710826).
     3) The cached photos were never actually loaded again. How embarrassing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697695

 backends/eds/lib/edsf-persona.vala |   35 ++++-------------------------------
 1 files changed, 4 insertions(+), 31 deletions(-)
---
diff --git a/backends/eds/lib/edsf-persona.vala b/backends/eds/lib/edsf-persona.vala
index 0a2c9bd..4a8d505 100644
--- a/backends/eds/lib/edsf-persona.vala
+++ b/backends/eds/lib/edsf-persona.vala
@@ -1556,47 +1556,20 @@ public class Edsf.Persona : Folks.Persona,
     {
       var p = this._get_property<E.ContactPhoto> ("photo");
 
-      var cache = AvatarCache.dup ();
-
       // Convert the ContactPhoto to a LoadableIcon and store or update it.
       var new_avatar = this._contact_photo_to_loadable_icon (p);
 
       if (this._avatar != null && new_avatar == null)
         {
-          // Remove the old cached avatar, ignoring errors.
-          cache.remove_avatar.begin (this.uid, (obj, res) =>
-            {
-              try
-                {
-                  cache.remove_avatar.end (res);
-                }
-              catch (GLib.Error e1) {}
-
-              this._avatar = null;
-              this.notify_property ("avatar");
-            });
+          this._avatar = null;
+          this.notify_property ("avatar");
         }
       else if ((this._avatar == null && new_avatar != null) ||
           (this._avatar != null && new_avatar != null &&
            ((!) this._avatar).equal (new_avatar) == false))
         {
-          /* Store the new avatar in the cache. new_avatar is guaranteed to be
-           * non-null. */
-          cache.store_avatar.begin (this.uid, (!) new_avatar, (obj, res) =>
-            {
-              try
-                {
-                  cache.store_avatar.end (res);
-                  this._avatar = new_avatar;
-                  this.notify_property ("avatar");
-                }
-              catch (GLib.Error e2)
-                {
-                  warning ("Couldn't cache avatar for Edsf.Persona '%s': %s",
-                      this.uid, e2.message);
-                  new_avatar = null; /* failure */
-                }
-            });
+          this._avatar = new_avatar;
+          this.notify_property ("avatar");
         }
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]