Compare commits

...

3 commits

Author SHA1 Message Date
shenleban tongying f694c3210e clean: QLocale country -> territory renaming
Some checks failed
SonarCloud / Build and analyze (push) Waiting to run
deploy_website / deploy (push) Has been cancelled
2024-11-07 03:01:45 -05:00
shenleban tongying 02143921f4
opt: disable Qt≤6.7 deprecated features and disable Qt deprecation warnings 2024-11-07 07:48:39 +00:00
shenleban tongying c864a9a897
clean: remaning deprecated QCryptographicHash::addData usages 2024-11-07 02:05:54 -05:00
6 changed files with 13 additions and 7 deletions

View file

@ -192,6 +192,12 @@ endif ()
#### Compile definitions #### Compile definitions
# Disable deprecated staffs for Qt<=6.7 (Bump this if ever consider bump Qt version)
target_compile_definitions(${GOLDENDICT} PRIVATE
QT_DISABLE_DEPRECATED_UP_TO=0x060700
QT_NO_DEPRECATED_WARNINGS
)
target_compile_definitions(${GOLDENDICT} PUBLIC target_compile_definitions(${GOLDENDICT} PUBLIC
CMAKE_USED_HACK # temporal hack to avoid breaking qmake build CMAKE_USED_HACK # temporal hack to avoid breaking qmake build
MAKE_QTMULTIMEDIA_PLAYER MAKE_QTMULTIMEDIA_PLAYER

View file

@ -721,8 +721,8 @@ void BglArticleRequest::run()
string const & targetHeadword = displayedHeadword.size() ? displayedHeadword : headword; string const & targetHeadword = displayedHeadword.size() ? displayedHeadword : headword;
QCryptographicHash hash( QCryptographicHash::Md5 ); QCryptographicHash hash( QCryptographicHash::Md5 );
hash.addData( targetHeadword.data(), targetHeadword.size() + 1 ); // with 0 hash.addData( { targetHeadword.data(), static_cast< qsizetype >( targetHeadword.size() + 1 ) } ); // with 0
hash.addData( articleText.data(), articleText.size() ); hash.addData( { articleText.data(), static_cast< qsizetype >( articleText.size() ) } );
if ( !articleBodiesIncluded.insert( hash.result() ).second ) { if ( !articleBodiesIncluded.insert( hash.result() ).second ) {
continue; // Already had this body continue; // Already had this body

View file

@ -621,7 +621,7 @@ void MdxArticleRequest::run()
} }
QCryptographicHash hash( QCryptographicHash::Md5 ); QCryptographicHash hash( QCryptographicHash::Md5 );
hash.addData( articleBody.data(), articleBody.size() ); hash.addData( { articleBody.data(), static_cast< qsizetype >( articleBody.length() ) } );
if ( !articleBodiesIncluded.insert( hash.result() ).second ) { if ( !articleBodiesIncluded.insert( hash.result() ).second ) {
continue; // Already had this body continue; // Already had this body
} }

View file

@ -88,8 +88,8 @@ QString MacMouseOver::CFStringRefToQString( CFStringRef str )
UniChar *chars = new UniChar[ length ]; UniChar *chars = new UniChar[ length ];
CFStringGetCharacters( str, CFRangeMake( 0, length ), chars ); CFStringGetCharacters( str, CFRangeMake( 0, length ), chars );
QString result = QString::fromUtf16( chars, length ); QString result = QString::fromUtf16( (char16_t*)chars, length );
delete[] chars; delete[] chars;
return result; return result;

View file

@ -39,7 +39,7 @@ SpeechClient::Engines SpeechClient::availableEngines()
for ( const QVoice & voice : sp->availableVoices() ) { for ( const QVoice & voice : sp->availableVoices() ) {
const QString name( QString( "%4 - %3 %1 (%2)" ) const QString name( QString( "%4 - %3 %1 (%2)" )
.arg( QLocale::languageToString( locale.language() ), .arg( QLocale::languageToString( locale.language() ),
( QLocale::countryToString( locale.country() ) ), ( QLocale::territoryToString( locale.territory() ) ),
voice.name(), voice.name(),
engine_name ) ); engine_name ) );
Engine engine( Config::VoiceEngine( engine_name, name, voice.name(), QLocale( locale ), 50, 0 ) ); Engine engine( Config::VoiceEngine( engine_name, name, voice.name(), QLocale( locale ), 50, 0 ) );

View file

@ -31,7 +31,7 @@ Requires Windows 10 (1809 or later).
* For ArchLinux, pre-built binary is available from [archlinuxcn's repo](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/goldendict-ng-git). * For ArchLinux, pre-built binary is available from [archlinuxcn's repo](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/goldendict-ng-git).
* [Gentoo package from PG_Overlay](https://gitlab.com/Perfect_Gentleman/PG_Overlay/-/tree/master/app-text/goldendict-ng) * [Gentoo package from PG_Overlay](https://gitlab.com/Perfect_Gentleman/PG_Overlay/-/tree/master/app-text/goldendict-ng)
Minimum supported "Linux" versions is supposedly the current Ubuntu LTS or Debian's old stable or Qt6.4. Minimum supported "Linux" version is supposedly the current Ubuntu LTS and Debian's oldstable.
## macOS ## macOS