Skip to content

Commit

Permalink
Merge pull request xiaoyifang#1927 from xiaoyifang/opt/group-empty-name
Browse files Browse the repository at this point in the history
opt: Group struct default constructor only invoked with empty string
  • Loading branch information
xiaoyifang authored Nov 8, 2024
2 parents d3ad40f + 081cba6 commit dcc4579
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/instances.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ Group::Group( Config::Group const & cfgGroup,
}
}

Group::Group( QString name_ ):
id( 0 ),
name( std::move( name_ ) )
Group::Group():
id( 0 )
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/instances.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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_ );

Expand Down
2 changes: 1 addition & 1 deletion src/ui/groups_widgets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void DictGroupWidget::groupIconActivated( int index )

Config::Group DictGroupWidget::makeGroup() const
{
Instances::Group g( "" );
Instances::Group g;

g.id = groupId;

Expand Down
4 changes: 2 additions & 2 deletions src/ui/orderandprops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ OrderAndProps::OrderAndProps( QWidget * parent,

Config::Group OrderAndProps::getCurrentDictionaryOrder() const
{
Instances::Group g( "" );
Instances::Group g;

g.dictionaries = ui.dictionaryOrder->getCurrentDictionaries();

Expand All @@ -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();

Expand Down

0 comments on commit dcc4579

Please sign in to comment.