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 > > QMap< std::string, sptr< Dictionary::Class > >
dictToMap( std::vector< sptr< Dictionary::Class > > const & dicts ); dictToMap( std::vector< sptr< Dictionary::Class > > const & dicts );
} }
#endif #endif

View file

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

View file

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