diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-03-17 20:32:12 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-03-17 20:32:12 +0100 |
commit | 21562eed759563d70561f630b481e8bc47651052 (patch) | |
tree | d65d0ef22c46218c4de7abc6e5e61da1e7242208 /src/MxcImageProvider.cpp | |
parent | Add missing QPointer include (diff) | |
download | nheko-21562eed759563d70561f630b481e8bc47651052.tar.xz |
Fix shadowing
Diffstat (limited to 'src/MxcImageProvider.cpp')
-rw-r--r-- | src/MxcImageProvider.cpp | 17 |
1 files 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)); |