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
This commit is contained in:
xiaoyifang 2024-11-08 20:59:40 +08:00 committed by GitHub
commit dcc4579544
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 7 deletions

View file

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

View file

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

View file

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

View file

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