Compare commits

..

1 commit

Author SHA1 Message Date
xiaoyifang 2b3a7a26fa
Merge 15b918eb6a into f694c3210e 2024-11-08 01:47:32 +00:00
6 changed files with 10 additions and 9 deletions

View file

@ -111,7 +111,7 @@ HotKey::HotKey( QKeySequence const & seq ):
QKeySequence HotKey::toKeySequence() const
{
if ( key2 != 0 && key2 != Qt::Key::Key_unknown ) {
if ( key2 != 0 || key2 != Qt::Key::Key_unknown ) {
return { QKeyCombination( modifiers, static_cast< Qt::Key >( key1 ) ),
QKeyCombination( modifiers, static_cast< Qt::Key >( key2 ) ) };
}

View file

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

View file

@ -32,7 +32,7 @@ struct Group
Config::Group const & inactiveGroup );
/// Creates an empty group.
explicit Group();
explicit Group( QString name_ );
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
setUpdatesEnabled( false );
ui.tabs->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 );
}
setUpdatesEnabled( true );
ui.tabs->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();