Qt6 port:

Fix deprecation warnings with version 6.3 or 6.4
This commit is contained in:
wmayer
2023-07-23 17:23:23 +02:00
committed by Chris Hennes
parent 68101ac933
commit 7d0926d0b3
9 changed files with 51 additions and 40 deletions

View File

@@ -903,7 +903,11 @@ std::string Document::getTransientDirectoryName(const std::string& uuid, const s
// Create a directory name of the form: {ExeName}_Doc_{UUID}_{HASH}_{PID}
std::stringstream s;
QCryptographicHash hash(QCryptographicHash::Sha1);
#if QT_VERSION < QT_VERSION_CHECK(6,3,0)
hash.addData(filename.c_str(), filename.size());
#else
hash.addData(QByteArrayView(filename.c_str(), filename.size()));
#endif
s << App::Application::getUserCachePath() << App::Application::getExecutableName()
<< "_Doc_" << uuid
<< "_" << hash.result().toHex().left(6).constData()