Mark files as being downloaded from the web on Windows
This commit is contained in:
parent
3b41d20506
commit
b37909a2c8
6 changed files with 25 additions and 3 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include <QBuffer>
|
||||
#include <QComboBox>
|
||||
#include <QCryptographicHash>
|
||||
#include <QFile>
|
||||
#include <QGuiApplication>
|
||||
#include <QImageReader>
|
||||
#include <QProcessEnvironment>
|
||||
|
|
@ -2230,3 +2231,18 @@ utils::parseMatrixUri(QString uri)
|
|||
.vias = std::move(vias),
|
||||
};
|
||||
}
|
||||
|
||||
void
|
||||
utils::markFileAsFromWeb(const QString &path [[maybe_unused]])
|
||||
{
|
||||
#ifdef Q_OS_WINDOWS
|
||||
QFile file(path + ":Zone.Identifier");
|
||||
if (!file.open(QIODevice::Truncate | QIODevice::WriteOnly)) {
|
||||
nhlog::net()->error("Failed to open alternate stream for {}", path.toStdString());
|
||||
return;
|
||||
}
|
||||
|
||||
file.write("[ZoneTransfer]\nZoneId=3");
|
||||
file.close();
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue