From a20aeaf659b61d4f9ed6c4d72ee7bcb563c01cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sat, 18 May 2013 20:54:14 +0200 Subject: Fixed selecting an avatar from a non-ASCII path. Change-Id: Ic22fc9a165da3f81388d37fafc9db993e5c34b83 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 #include +#include 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(vecptr(data)), data.size()); -- cgit v0.10.2-6-g49f6