[folks] folks-inspect: print an Avatar's uri



commit f4ca6a2e378783a6c392a12ebfbd11ef3ac8d084
Author: Raul Gutierrez Segales <raul gutierrez segales collabora co uk>
Date:   Fri Mar 11 00:40:14 2011 +0000

    folks-inspect: print an Avatar's uri
    
    Fixes: bgo#644165 - An individual's avatar shouldn't be replaced by a null
    avatar

 NEWS                      |    1 +
 tools/inspect/Makefile.am |    3 +++
 tools/inspect/utils.vala  |    6 +++++-
 3 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/NEWS b/NEWS
index 265b44d..e012e93 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Bugs fixed:
 * Bug 643955 â?? Add to_string () to RoleOwner class
 * Bug 643957 â?? Deal handle birthday and postal-addresses.
 * Bug 644457 â?? Handle structured names
+* Bug 644165 â?? An individual's avatar shouldn't be replaced by a null avatar
 
 API changes:
 * Add RoleDetails interface
diff --git a/tools/inspect/Makefile.am b/tools/inspect/Makefile.am
index 715574a..bb815b5 100644
--- a/tools/inspect/Makefile.am
+++ b/tools/inspect/Makefile.am
@@ -2,6 +2,7 @@ VALAFLAGS = \
 	--vapidir=$(top_srcdir)/folks \
 	--pkg=readline \
 	--pkg=gobject-2.0 \
+	--pkg=gio-2.0 \
 	--pkg=gee-1.0 \
 	--pkg=folks \
 	$(NULL)
@@ -22,12 +23,14 @@ folks_inspect_SOURCES = \
 	$(NULL)
 folks_inspect_LDADD = \
 	$(LIBREADLINE) \
+	$(GIO_LIBS) \
 	$(GLIB_LIBS) \
 	$(GEE_LIBS) \
 	$(top_builddir)/folks/libfolks.la \
 	$(NULL)
 folks_inspect_CFLAGS = \
 	-I$(top_srcdir)/folks \
+	$(GIO_CFLAGS) \
 	$(GLIB_CFLAGS) \
 	$(GEE_CFLAGS) \
 	$(NULL)
diff --git a/tools/inspect/utils.vala b/tools/inspect/utils.vala
index 12e3b17..e62975c 100644
--- a/tools/inspect/utils.vala
+++ b/tools/inspect/utils.vala
@@ -258,7 +258,11 @@ private class Folks.Inspect.Utils
         }
       else if (prop_name == "avatar")
         {
-          return "%p".printf (prop_value.get_object ());
+          string ret = null;
+          File avatar = (File) prop_value.get_object ();
+          if (avatar != null)
+            ret = avatar.get_uri ();
+          return ret;
         }
       else if (prop_name == "im-addresses")
         {



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