From 94ea6c570cb5bdd4214b8a0b63a69160440a2592 Mon Sep 17 00:00:00 2001 From: shenleban tongying Date: Sun, 6 Oct 2024 17:11:11 -0400 Subject: [PATCH] clean: deprecated QCryptographicHash::addData --- src/dict/dictionary.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dict/dictionary.cc b/src/dict/dictionary.cc index 1cd646f8..2e3f6fbd 100644 --- a/src/dict/dictionary.cc +++ b/src/dict/dictionary.cc @@ -516,7 +516,8 @@ string makeDictionaryId( vector< string > const & dictionaryFiles ) noexcept QCryptographicHash hash( QCryptographicHash::Md5 ); for ( const auto & i : sortedList ) { - hash.addData( i.c_str(), i.size() + 1 ); + // Note: a null byte at the end is a must + hash.addData( { i.c_str(), static_cast< qsizetype >( i.size() + 1 ) } ); } return hash.result().toHex().data();