mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
replace dictionary vector with QMap
remove signal DictGroupWidget::showDictionaryInfo
This commit is contained in:
parent
c664ac315c
commit
0560785a65
|
@ -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
|
||||||
|
|
|
@ -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 );
|
||||||
|
|
|
@ -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++ )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue