File tree 1 file changed +16
-6
lines changed
1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -201,12 +201,22 @@ void IMPage::selectedGroupChanged() {
201
201
return ;
202
202
}
203
203
if (!config_->currentGroup ().isEmpty () && config_->needSave ()) {
204
- if (QMessageBox::No ==
205
- QMessageBox::question (this , _ (" Current group changed" ),
206
- _ (" Do you want to change group? Changes to "
207
- " current group will be lost!" ))) {
208
- ui_->inputMethodGroupComboBox ->setCurrentText (
209
- config_->currentGroup ());
204
+ if (QMessageBox::No == QMessageBox::question (
205
+ this , _ (" Current group changed" ),
206
+ _ (" Do you want to change group? Changes to current group will be "
207
+ " lost!" ))) {
208
+ // Temporarily disconnect our signal handler
209
+ QMetaObject::Connection connection =
210
+ disconnect (ui_->inputMethodGroupComboBox ,
211
+ &QComboBox::currentTextChanged, this ,
212
+ &IMPage::selectedGroupChanged);
213
+ ui_->inputMethodGroupComboBox ->setCurrentText (config_->currentGroup ());
214
+ // Restore our signal handler
215
+ if (connection) {
216
+ connect (ui_->inputMethodGroupComboBox ,
217
+ &QComboBox::currentTextChanged, this ,
218
+ &IMPage::selectedGroupChanged);
219
+ }
210
220
return ;
211
221
}
212
222
}
You can’t perform that action at this time.
0 commit comments