@@ -113,13 +113,13 @@ def __init__(self, *args, **kwargs):
113113 self .toolButton_rem .clicked .connect (self .on_rem_resources )
114114 self .pushButton_proceed .clicked .connect (self .on_proceed )
115115 # resource-related signals
116- self .lineEdit_res_filename .textChanged .connect (
116+ self .lineEdit_res_filename .textEdited .connect (
117117 self .on_update_resources_model )
118118 self .widget_schema .schema_changed .connect (
119119 self .on_update_resources_model )
120120 self .selModel .selectionChanged .connect (self .on_selection_changed )
121121 # do not allow to proceed without a title
122- self .lineEdit_authors .textChanged .connect (self .on_authors_edited )
122+ self .lineEdit_authors .textEdited .connect (self .on_authors_edited )
123123 self .on_authors_edited ("" ) # initial state
124124 # if the user changes the preset combobox text, offer them
125125 # to save it as a preset
@@ -408,9 +408,7 @@ def on_selection_changed(self):
408408 self .groupBox_res_info .show ()
409409 # populate
410410 path , data = self .rvmodel .get_data_for_index (sel [0 ])
411- self .lineEdit_res_filename .blockSignals (True )
412411 self .lineEdit_res_filename .setText (data ["file" ]["filename" ])
413- self .lineEdit_res_filename .blockSignals (False )
414412 self .lineEdit_res_path .setText (path )
415413 else : # hide resource options
416414 self .groupBox_res_info .hide ()
@@ -440,11 +438,18 @@ def on_update_resources_model(self):
440438 fn = self .lineEdit_res_filename .text ()
441439 if not fn .endswith (suffix ):
442440 fn += suffix
443- self .lineEdit_res_filename .blockSignals (True )
444441 self .lineEdit_res_filename .setText (fn )
445- self .lineEdit_res_filename .blockSignals (False )
446- if fn != path .name : # only update filename if user changed it
447- data_dict ["file" ] = {"filename" : fn }
442+ # In DCOR-Aid <= 0.17.1, we had an additional check for whether
443+ # the `path` in the model is different to `fn`. There probably
444+ # were race conditions which caused the model to be updated
445+ # while we were checking this here. So the solution is to not
446+ # check for changes and always pass through the user input. We
447+ # also moved away from `textChanged` signals to `textEdited`
448+ # signals. `textEdited` means user-edited while `textChanged`
449+ # also includes programmatical changes (we used to block signals
450+ # for the lineEdit which we now don't have to do anymore).
451+ # See issue #84.
452+ data_dict ["file" ] = {"filename" : fn }
448453 # collect supplementary resource data
449454 schema = self .widget_schema .get_current_schema ()
450455 if schema : # only update supplement if user made changes
0 commit comments