diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2007-11-05 08:52:50 +0300 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2007-11-05 08:52:50 +0300 |
commit | 57c3221d90b36a90c786c829e04ee1421b68878b (patch) | |
tree | 7aed2b653c44b1fdec7d4d0cacfc36954c7ccfe8 /src/profile_window.py | |
parent | c15b616ddd409afb634ccd1efdf9a4ad7a8752fb (diff) |
[misc] remove duplicate function. fixes #3524
Diffstat (limited to 'src/profile_window.py')
-rw-r--r-- | src/profile_window.py | 28 |
1 files 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() |