From 57c3221d90b36a90c786c829e04ee1421b68878b Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 5 Nov 2007 05:52:50 +0000 Subject: [PATCH] [misc] remove duplicate function. fixes #3524 --- src/profile_window.py | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/profile_window.py b/src/profile_window.py index e16f890d1..642f14241 100644 --- a/src/profile_window.py +++ b/src/profile_window.py @@ -28,35 +28,11 @@ import os import gtkgui_helpers import dialogs +import vcard from common import gajim from common.i18n import Q_ -def get_avatar_pixbuf_encoded_mime(photo): - '''return the pixbuf of the image - photo is a dictionary containing PHOTO information''' - if not isinstance(photo, dict): - return None, None, None - img_decoded = None - avatar_encoded = None - avatar_mime_type = None - if photo.has_key('BINVAL'): - img_encoded = photo['BINVAL'] - avatar_encoded = img_encoded - try: - img_decoded = base64.decodestring(img_encoded) - except: - pass - if img_decoded: - if photo.has_key('TYPE'): - avatar_mime_type = photo['TYPE'] - pixbuf = gtkgui_helpers.get_pixbuf_from_data(img_decoded) - else: - pixbuf, avatar_mime_type = gtkgui_helpers.get_pixbuf_from_data( - img_decoded, want_type=True) - else: - pixbuf = None - return pixbuf, avatar_encoded, avatar_mime_type class ProfileWindow: '''Class for our information window''' @@ -228,7 +204,7 @@ class ProfileWindow: for i in vcard.keys(): if i == 'PHOTO': pixbuf, self.avatar_encoded, self.avatar_mime_type = \ - get_avatar_pixbuf_encoded_mime(vcard[i]) + vcard.get_avatar_pixbuf_encoded_mime(vcard[i]) if not pixbuf: image.set_from_pixbuf(None) button.hide()