From 21562eed759563d70561f630b481e8bc47651052 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 17 Mar 2021 20:32:12 +0100 Subject: [PATCH] Fix shadowing --- src/MxcImageProvider.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/MxcImageProvider.cpp b/src/MxcImageProvider.cpp index 023d0e57..a20657c8 100644 --- a/src/MxcImageProvider.cpp +++ b/src/MxcImageProvider.cpp @@ -128,10 +128,11 @@ MxcImageProvider::download(const QString &id, f.open(QIODevice::ReadOnly); QByteArray fileData = f.readAll(); - auto temp = + auto tempData = mtx::crypto::to_string(mtx::crypto::decrypt_file( fileData.toStdString(), encryptionInfo.value())); - auto data = QByteArray(temp.data(), (int)temp.size()); + auto data = + QByteArray(tempData.data(), (int)tempData.size()); QImage image = utils::readImage(data); image.setText("mxc url", "mxc://" + id); if (!image.isNull()) { @@ -165,19 +166,21 @@ MxcImageProvider::download(const QString &id, return; } - auto temp = res; + auto tempData = res; QFile f(fileInfo.absoluteFilePath()); if (!f.open(QIODevice::Truncate | QIODevice::WriteOnly)) { then(id, QSize(), {}, ""); return; } - f.write(temp.data(), temp.size()); + f.write(tempData.data(), tempData.size()); f.close(); if (encryptionInfo) { - temp = mtx::crypto::to_string(mtx::crypto::decrypt_file( - temp, encryptionInfo.value())); - auto data = QByteArray(temp.data(), (int)temp.size()); + tempData = + mtx::crypto::to_string(mtx::crypto::decrypt_file( + tempData, encryptionInfo.value())); + auto data = + QByteArray(tempData.data(), (int)tempData.size()); QImage image = utils::readImage(data); image.setText("original filename", QString::fromStdString(originalFilename));