diff --git a/src/article_maker.cc b/src/article_maker.cc index f525b14f..5c1d6920 100644 --- a/src/article_maker.cc +++ b/src/article_maker.cc @@ -271,7 +271,7 @@ sptr< Dictionary::DataRequest > ArticleMaker::makeDefinitionFor( string header = makeHtmlHeader( phrase.phrase, QString(), true ); - return std::make_shared( phrase, Instances::Group{}, + return std::make_shared( phrase, Instances::Group{groupId,""}, contexts, ftsDicts, header, -1, true ); } @@ -731,6 +731,7 @@ void ArticleRequest::bodyFinished() } } + ActiveDictIds hittedWord{ group.id, word, dictIds }; if ( bodyRequests.empty() ) { @@ -775,23 +776,24 @@ void ArticleRequest::bodyFinished() appendDataSlice( footer.data(), footer.size() ); } + if ( stemmedWordFinder.get() ) { update(); - qDebug() << "send dicts(stemmed):" << word << ":" << dictIds; - emit GlobalBroadcaster::instance()->dictionaryChanges( ActiveDictIds{ group.id, word, dictIds } ); + qDebug() << "send dicts(stemmed):" << hittedWord; + emit GlobalBroadcaster::instance()->dictionaryChanges( hittedWord ); dictIds.clear(); } else { finish(); - qDebug() << "send dicts(finished):" << word << ":" << dictIds; - emit GlobalBroadcaster::instance()->dictionaryChanges( ActiveDictIds{ group.id, word, dictIds } ); + qDebug() << "send dicts(finished):" << hittedWord; + emit GlobalBroadcaster::instance()->dictionaryChanges( hittedWord ); dictIds.clear(); } } else if ( wasUpdated ) { update(); - qDebug() << "send dicts(updated):" << word << ":" << dictIds; - emit GlobalBroadcaster::instance()->dictionaryChanges( ActiveDictIds{ group.id, word, dictIds } ); + qDebug() << "send dicts(updated):" << hittedWord; + emit GlobalBroadcaster::instance()->dictionaryChanges( hittedWord ); dictIds.clear(); } } diff --git a/src/article_netmgr.cc b/src/article_netmgr.cc index 45b0bca5..e093341c 100644 --- a/src/article_netmgr.cc +++ b/src/article_netmgr.cc @@ -287,7 +287,7 @@ sptr< Dictionary::DataRequest > ArticleNetworkAccessManager::getResource( { // Individual dictionaries set from full-text search QStringList dictIDList = dictIDs.split( "," ); - return articleMaker.makeDefinitionFor( phrase, 0, QMap< QString, QString >(), QSet< QString >(), dictIDList ); + return articleMaker.makeDefinitionFor( phrase, group, QMap< QString, QString >(), QSet< QString >(), dictIDList ); } // See if we have some dictionaries muted diff --git a/src/common/globalbroadcaster.hh b/src/common/globalbroadcaster.hh index e3fd37da..9ff0be07 100644 --- a/src/common/globalbroadcaster.hh +++ b/src/common/globalbroadcaster.hh @@ -11,6 +11,11 @@ struct ActiveDictIds unsigned groupId; QString word; QStringList dictIds; + + operator QString() const + { + return QString( "groupId:%1,word:%2,dictId:%3" ).arg( QString::number( groupId ), word, dictIds.join( "," ) ); + } }; class GlobalBroadcaster : public QObject diff --git a/src/instances.hh b/src/instances.hh index 4ef283fc..2e9d18cb 100644 --- a/src/instances.hh +++ b/src/instances.hh @@ -37,8 +37,6 @@ struct Group Group(unsigned id, QString const & name_); - Group() = default; - /// Makes the configuration group from the current contents. Config::Group makeConfigGroup();