From 3ee9613b8769443633eb8d1b78298bae30e36bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=92=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Thu, 24 Mar 2016 08:36:59 +0300 Subject: [PATCH] avatar load fix --- src/profile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/profile.py b/src/profile.py index 65958f2..e6e1677 100644 --- a/src/profile.py +++ b/src/profile.py @@ -162,9 +162,11 @@ class Contact(object): """ Tries to load avatar of contact or uses default avatar """ - avatar_path = (ProfileHelper.get_path() + 'avatars/{}.png').format(self._tox_id[:TOX_PUBLIC_KEY_SIZE * 2]) + avatar_path = '{}.png'.format(self._tox_id[:TOX_PUBLIC_KEY_SIZE * 2]) + os.chdir(ProfileHelper.get_path() + 'avatars/') if not os.path.isfile(avatar_path): # load default image - avatar_path = curr_directory() + '/images/avatar.png' + avatar_path = 'avatar.png' + os.chdir(curr_directory() + '/images/') pixmap = QtGui.QPixmap(QtCore.QSize(64, 64)) pixmap.scaled(64, 64, QtCore.Qt.KeepAspectRatio) self._widget.avatar_label.setPixmap(avatar_path)