[gnome-contacts] Bug 705431 — Replace MemoryIcon wi th GBytesIcon



commit db219966e99a5c6416f53ff8fa005853c7195643
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sun Aug 4 10:57:25 2013 +0200

    Bug 705431 — Replace MemoryIcon with GBytesIcon
    
    This bumps the GLib dependency to 2.37.6.
    
    Closes: https://bugzilla.gnome.org/show_bug.cgi?id=705431

 configure.ac                    |    2 +-
 src/Makefile.am                 |    1 -
 src/contacts-avatar-dialog.vala |    9 +++-
 src/memory-icon.vala            |   88 ---------------------------------------
 4 files changed, 8 insertions(+), 92 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 69d4bca..34d970d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,7 +36,7 @@ AC_SUBST(GETTEXT_PACKAGE)
 
 
 pkg_modules="gtk+-3.0 >= 3.9.1
-            glib-2.0 >= 2.31.10
+            glib-2.0 >= 2.37.6
             gnome-desktop-3.0
             folks >= 0.7.3
             folks-telepathy
diff --git a/src/Makefile.am b/src/Makefile.am
index a27a739..2d38e1d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -46,7 +46,6 @@ vala_sources = \
        contacts-setup-window.vala \
        contacts-window.vala \
        main.vala \
-       memory-icon.vala \
        $(NULL)
 
 gsettings_ENUM_NAMESPACE = org.gnome.Contacts
diff --git a/src/contacts-avatar-dialog.vala b/src/contacts-avatar-dialog.vala
index 70620a4..c80b7bb 100644
--- a/src/contacts-avatar-dialog.vala
+++ b/src/contacts-avatar-dialog.vala
@@ -439,8 +439,13 @@ public class Contacts.AvatarDialog : Dialog {
        if (response_id == ResponseType.CLOSE) {
          if (new_pixbuf != null) {
            try {
-             var icon = new MemoryIcon.from_pixbuf (new_pixbuf);
-             set_avatar (icon);
+             uint8[] buffer;
+             if (new_pixbuf.save_to_buffer (out buffer, "png", null)) {
+               var icon = new BytesIcon (new Bytes (buffer));
+               set_avatar (icon);
+             } else {
+               /* Failure. Fall through. */
+             }
            } catch {
            }
          }


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