diff --git a/article_maker.cc b/article_maker.cc index 53d45ce0..b27c53fd 100644 --- a/article_maker.cc +++ b/article_maker.cc @@ -430,6 +430,7 @@ ArticleRequest::ArticleRequest( memcpy( &data.front(), header.data(), header.size() ); // Accumulate main forms + emit GlobalBroadcaster::instance()->dictionaryClear( ActiveDictIds{word} ); for( unsigned x = 0; x < activeDicts.size(); ++x ) { @@ -449,8 +450,6 @@ void ArticleRequest::altSearchFinished() if ( altsDone ) return; - emit GlobalBroadcaster::instance()->dictionaryClear( ActiveDictIds{word} ); - // Check every request for finishing for( list< sptr< Dictionary::WordSearchRequest > >::iterator i = altSearches.begin(); i != altSearches.end(); ) diff --git a/article_netmgr.cc b/article_netmgr.cc index 7498b4a9..6638d432 100644 --- a/article_netmgr.cc +++ b/article_netmgr.cc @@ -252,9 +252,9 @@ QNetworkReply * ArticleNetworkAccessManager::getArticleReply( QNetworkRequest co sptr< Dictionary::DataRequest > ArticleNetworkAccessManager::getResource( QUrl const & url, QString & contentType ) { - GD_DPRINTF( "getResource: %ls", url.toString().toStdWString().c_str() ); - GD_DPRINTF( "scheme: %ls", url.scheme().toStdWString().c_str() ); - GD_DPRINTF( "host: %ls", url.host().toStdWString().c_str() ); + qDebug() << "getResource:" << url.toString(); + qDebug() << "scheme:" << url.scheme(); + qDebug() << "host:" << url.host(); if ( url.scheme() == "gdlookup" ) { diff --git a/articleview.cc b/articleview.cc index ea7664d5..f03d1bd7 100644 --- a/articleview.cc +++ b/articleview.cc @@ -1668,7 +1668,6 @@ void ArticleView::playSound() }); } -// use eventloop to turn the async callback to sync execution. void ArticleView::toHtml( const std::function< void( QString & ) > & callback ) { ui.definition->page()->toHtml( @@ -2079,7 +2078,7 @@ void ArticleView::resourceDownloadFinished() { if ( (*i)->isFinished() ) { - if ( (*i)->dataSize() >= 0 ) + if ( (*i)->dataSize() > 0 ) { // Ok, got one finished, all others are irrelevant now diff --git a/goldendict.pro b/goldendict.pro index a24facaf..381d6a21 100644 --- a/goldendict.pro +++ b/goldendict.pro @@ -667,5 +667,14 @@ TS_OUT = $$TRANSLATIONS TS_OUT ~= s/.ts/.qm/g PRE_TARGETDEPS += $$TS_OUT +equals(QT_VERSION,6.4.0){ + #QTBUG-105984 + multimedia.files = $$[QT_INSTALL_PLUGINS]/multimedia/* + multimedia.path = plugins/multimedia + #multimedia.CONFIG += no_check_exist + message("copy qt6.4.0 multimedia") + INSTALLS += multimedia +} + include( thirdparty/qtsingleapplication/src/qtsingleapplication.pri ) diff --git a/scanpopup.cc b/scanpopup.cc index 26197c54..533e7ec7 100644 --- a/scanpopup.cc +++ b/scanpopup.cc @@ -202,11 +202,17 @@ ScanPopup::ScanPopup( QWidget * parent, if( cfg.popupWindowAlwaysOnTop ) flags |= Qt::WindowStaysOnTopHint; setWindowFlags( flags ); +#ifdef Q_OS_MACOS + setAttribute(Qt::WA_MacAlwaysShowToolWindow); +#endif } else { dictionaryBar.setMovable( false ); setWindowFlags( unpinnedWindowFlags() ); +#ifdef Q_OS_MACOS + setAttribute(Qt::WA_MacAlwaysShowToolWindow, false); +#endif } connect( &configEvents, SIGNAL( mutedDictionariesChanged() ), @@ -1070,6 +1076,10 @@ void ScanPopup::pinButtonClicked( bool checked ) flags |= Qt::WindowStaysOnTopHint; setWindowFlags( flags ); +#ifdef Q_OS_MACOS + setAttribute(Qt::WA_MacAlwaysShowToolWindow); +#endif + setWindowTitle( tr( "%1 - %2" ).arg( elideInputWord(), "GoldenDict" ) ); dictionaryBar.setMovable( true ); hideTimer.stop(); @@ -1080,6 +1090,10 @@ void ScanPopup::pinButtonClicked( bool checked ) dictionaryBar.setMovable( false ); setWindowFlags( unpinnedWindowFlags() ); +#ifdef Q_OS_MACOS + setAttribute(Qt::WA_MacAlwaysShowToolWindow, false); +#endif + mouseEnteredOnce = true; } cfg.pinPopupWindow = checked;