Compare commits

...

4 commits

Author SHA1 Message Date
xiaoyifang dcc4579544
Merge pull request #1927 from xiaoyifang/opt/group-empty-name
Some checks failed
SonarCloud / Build and analyze (push) Has been cancelled
opt: Group struct default constructor only invoked with empty string
2024-11-08 20:59:40 +08:00
xiaoyifang d3ad40f988
Merge pull request #1924 from xiaoyifang/opt/tab-blank
opt: dictionary tab switch will show blank widget when source changing.
2024-11-08 20:55:42 +08:00
xiaoyifang 081cba6b23 opt: Group struct default constructor only invoked with empty string 2024-11-08 20:49:55 +08:00
xiaoyifang 59f9b3d04f opt: dictionary tab switch show blank widget when source changed 2024-11-08 20:48:31 +08:00
5 changed files with 8 additions and 9 deletions

View file

@ -53,9 +53,8 @@ Group::Group( Config::Group const & cfgGroup,
}
}
Group::Group( QString name_ ):
id( 0 ),
name( std::move( name_ ) )
Group::Group():
id( 0 )
{
}

View file

@ -32,7 +32,7 @@ struct Group
Config::Group const & inactiveGroup );
/// Creates an empty group.
explicit Group( QString name_ );
explicit Group();
Group( unsigned id, QString name_ );

View file

@ -200,7 +200,7 @@ void EditDictionaries::acceptChangedSources( bool rebuildGroups )
#ifndef NO_TTS_SUPPORT
cfg.voiceEngines = sources.getVoiceEngines();
#endif
ui.tabs->setUpdatesEnabled( false );
setUpdatesEnabled( false );
// Those hold pointers to dictionaries, we need to free them.
groupInstances.clear();
@ -225,7 +225,7 @@ void EditDictionaries::acceptChangedSources( bool rebuildGroups )
connect( groups, &Groups::showDictionaryInfo, this, &EditDictionaries::showDictionaryInfo );
connect( orderAndProps, &OrderAndProps::showDictionaryHeadwords, this, &EditDictionaries::showDictionaryHeadwords );
}
ui.tabs->setUpdatesEnabled( true );
setUpdatesEnabled( true );
}
EditDictionaries::~EditDictionaries()
{

View file

@ -122,7 +122,7 @@ void DictGroupWidget::groupIconActivated( int index )
Config::Group DictGroupWidget::makeGroup() const
{
Instances::Group g( "" );
Instances::Group g;
g.id = groupId;

View file

@ -135,7 +135,7 @@ OrderAndProps::OrderAndProps( QWidget * parent,
Config::Group OrderAndProps::getCurrentDictionaryOrder() const
{
Instances::Group g( "" );
Instances::Group g;
g.dictionaries = ui.dictionaryOrder->getCurrentDictionaries();
@ -144,7 +144,7 @@ Config::Group OrderAndProps::getCurrentDictionaryOrder() const
Config::Group OrderAndProps::getCurrentInactiveDictionaries() const
{
Instances::Group g( "" );
Instances::Group g;
g.dictionaries = ui.inactiveDictionaries->getCurrentDictionaries();