diff options
author | Remko Tronçon <git@el-tramo.be> | 2013-05-18 18:54:14 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2013-05-18 18:54:14 (GMT) |
commit | a20aeaf659b61d4f9ed6c4d72ee7bcb563c01cba (patch) | |
tree | 8cded0b85fb92e35bf20d856550fa32c9c66bba8 /Swift/QtUI | |
parent | de39ce6ec44647cee92853e2928cf5475af992e6 (diff) | |
download | swift-a20aeaf659b61d4f9ed6c4d72ee7bcb563c01cba.zip swift-a20aeaf659b61d4f9ed6c4d72ee7bcb563c01cba.tar.bz2 |
Fixed selecting an avatar from a non-ASCII path.
Change-Id: Ic22fc9a165da3f81388d37fafc9db993e5c34b83
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtAvatarWidget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Swift/QtUI/QtAvatarWidget.cpp b/Swift/QtUI/QtAvatarWidget.cpp index ae9559a..015c2da 100644 --- a/Swift/QtUI/QtAvatarWidget.cpp +++ b/Swift/QtUI/QtAvatarWidget.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Remko Tronçon + * Copyright (c) 2011-2013 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -19,6 +19,7 @@ #include <QPainter> #include <QtSwiftUtil.h> +#include <Swiften/Base/Path.h> namespace Swift { @@ -84,7 +85,7 @@ void QtAvatarWidget::mousePressEvent(QMouseEvent* event) { QString fileName = QFileDialog::getOpenFileName(this, tr("Select picture"), "", tr("Image Files (*.png *.jpg *.jpeg *.gif)")); if (!fileName.isEmpty()) { ByteArray data; - readByteArrayFromFile(data, Q2PSTRING(fileName)); + readByteArrayFromFile(data, stringToPath(Q2PSTRING(fileName))); QBuffer buffer; buffer.setData(reinterpret_cast<const char*>(vecptr(data)), data.size()); |