Mark files as being downloaded from the web on Windows

This commit is contained in:
Nicolas Werner 2024-09-09 23:15:45 +02:00
parent 3b41d20506
commit b37909a2c8
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
6 changed files with 25 additions and 3 deletions

View file

@ -279,9 +279,10 @@ MxcImageProvider::download(const QString &id,
}
}
image.setText(QStringLiteral("mxc url"), "mxc://" + id);
if (image.save(fileInfo.absoluteFilePath(), "png"))
if (image.save(fileInfo.absoluteFilePath(), "png")) {
utils::markFileAsFromWeb(fileInfo.absoluteFilePath());
nhlog::ui()->debug("Wrote: {}", fileInfo.absoluteFilePath().toStdString());
else
} else
nhlog::ui()->debug("Failed to write: {}",
fileInfo.absoluteFilePath().toStdString());
@ -356,6 +357,7 @@ MxcImageProvider::download(const QString &id,
}
f.write(tempData.data(), tempData.size());
f.close();
utils::markFileAsFromWeb(fileInfo.absoluteFilePath());
if (encryptionInfo) {
tempData = mtx::crypto::to_string(