Skip to content

Commit

Permalink
SelectRows: Index attrs only by visible in set_data
Browse files Browse the repository at this point in the history
In `set_data` we calculate the index of an attribute that is passed to `add_rows`. Since `add_rows` only consider visible attributes the index has to be calculated only on visible as well.

Otherwise this caused `attr_combo.setCurrentIndex` to be set to values larger than the number of items inside it. Strangely this works but causes `attr_combo.currentText()` to returns an empty string which of course breaks indexing on domain.
  • Loading branch information
nikicc committed Jul 1, 2016
1 parent be46877 commit 477fb12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Orange/widgets/data/owselectrows.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def set_data(self, data):
self.update_info(data, self.data_in_variables, "In: ")
for attr, cond_type, cond_value in self.conditions:
attrs = [a.name for a in
data.domain.variables + data.domain.metas]
filter_visible(chain(data.domain.variables, data.domain.metas))]
if attr in attrs:
self.add_row(attrs.index(attr), cond_type, cond_value)
self.unconditional_commit()
Expand Down

0 comments on commit 477fb12

Please sign in to comment.