replace dictionary vector with QMap

remove signal DictGroupWidget::showDictionaryInfo
This commit is contained in:
xiaoyifang 2022-03-14 08:22:31 +08:00
parent c664ac315c
commit 0560785a65
3 changed files with 3 additions and 5 deletions

View file

@ -481,6 +481,7 @@ QString generateRandomDictionaryId();
QMap< std::string, sptr< Dictionary::Class > >
dictToMap( std::vector< sptr< Dictionary::Class > > const & dicts );
}
#endif

View file

@ -585,8 +585,7 @@ void DictGroupsWidget::populate( Config::Groups const & groups,
{
DictGroupWidget *gr = new DictGroupWidget( this, *allDicts, groups[ x ] );
addTab( gr, escapeAmps( groups[ x ].name ) );
connect( gr, SIGNAL( showDictionaryInfo( QString const & ) ),
this, SIGNAL( showDictionaryInfo( QString const & ) ) );
// connect( gr, &DictGroupWidget::showDictionaryInfo,this, &DictGroupsWidget::showDictionaryInfo );
connect( gr->getModel(), SIGNAL( contentChanged() ), this, SLOT( tabDataChanged() ) );
setCurrentIndex( x );

View file

@ -1346,9 +1346,7 @@ void MainWindow::makeDictionaries()
loadDictionaries( this, isVisible(), cfg, dictionaries, dictNetMgr, false );
//create map
for(const auto &dict:dictionaries){
dictMap.insert(dict->getId(),dict);
}
dictMap = Dictionary::dictToMap(dictionaries);
for( unsigned x = 0; x < dictionaries.size(); x++ )
{