summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-05-03 20:39:27 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-05-05 19:43:14 (GMT)
commit772b2ec0243d7b55d91e4027d828881d18093ed0 (patch)
tree83a58b2b97f3992165ee20c05e0630452eb50457 /Swift/QtUI
parent0b3db8fd68abee7269d5a38aabd8a816e099eae5 (diff)
downloadswift-contrib-772b2ec0243d7b55d91e4027d828881d18093ed0.zip
swift-contrib-772b2ec0243d7b55d91e4027d828881d18093ed0.tar.bz2
Replace ByteArray by typedef.
Diffstat (limited to 'Swift/QtUI')
-rw-r--r--Swift/QtUI/QtAvatarWidget.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Swift/QtUI/QtAvatarWidget.cpp b/Swift/QtUI/QtAvatarWidget.cpp
index 3e3aa69..1efb787 100644
--- a/Swift/QtUI/QtAvatarWidget.cpp
+++ b/Swift/QtUI/QtAvatarWidget.cpp
@@ -47,8 +47,8 @@ void QtAvatarWidget::setAvatar(const ByteArray& data, const std::string& type) {
this->type = type;
QImage image;
- if (!data.isEmpty()) {
- image.loadFromData(reinterpret_cast<const uchar*>(data.getData()), data.getSize());
+ if (!data.empty()) {
+ image.loadFromData(reinterpret_cast<const uchar*>(vecptr(data)), data.size());
}
if (image.isNull()) {
@@ -81,10 +81,10 @@ void QtAvatarWidget::mousePressEvent(QMouseEvent* event) {
QString fileName = QFileDialog::getOpenFileName(this, tr("Select picture"), "", tr("Image Files (*.png *.jpg *.gif)"));
if (!fileName.isEmpty()) {
ByteArray data;
- data.readFromFile(Q2PSTRING(fileName));
+ readByteArrayFromFile(data, Q2PSTRING(fileName));
QBuffer buffer;
- buffer.setData(reinterpret_cast<const char*>(data.getData()), data.getSize());
+ buffer.setData(reinterpret_cast<const char*>(vecptr(data)), data.size());
buffer.open(QIODevice::ReadOnly);
QString type = QImageReader::imageFormat(&buffer).toLower();
if (!type.isEmpty()) {