File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -656,26 +656,26 @@ def fill_combo_values( # noqa: C901
656656 elem .append (row [x ])
657657 records .append (elem )
658658
659- combo .blockSignals (True )
660- if combo_clear :
661- combo .clear ()
662- records_sorted = records
663-
659+ signals_blocked = combo .blockSignals (True )
664660 try :
665- if sort_combo :
666- records_sorted = sorted (records , key = operator .itemgetter (sort_by ))
667- except Exception :
668- pass
669- finally :
661+ if combo_clear :
662+ combo .clear ()
663+ records_sorted = records
664+ try :
665+ if sort_combo :
666+ records_sorted = sorted (records , key = operator .itemgetter (sort_by ))
667+ except Exception :
668+ pass
670669 if add_empty :
671670 records_sorted .insert (0 , ["" , "" ])
672671
673672 for record in records_sorted :
674673 combo .addItem (str (record [index_to_show ]), record )
675- combo .blockSignals (False )
676674
677- if None not in (selected_id , index_to_compare ):
678- set_combo_value (combo , selected_id , index_to_compare )
675+ if None not in (selected_id , index_to_compare ):
676+ set_combo_value (combo , selected_id , index_to_compare )
677+ finally :
678+ combo .blockSignals (signals_blocked )
679679
680680
681681def set_combo_item_unselectable_by_id (qcombo , list_id = None ):
You can’t perform that action at this time.
0 commit comments