Skip to content

Commit

Permalink
owselectrows: Fix duplicated intial filter when context is not restored
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Jan 3, 2017
1 parent 0759d93 commit aaf594c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Orange/widgets/data/owselectrows.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,17 @@ def set_data(self, data):
except Exception:
pass

if not self.conditions and len(data.domain.variables):
variables = list(filter_visible(chain(data.domain.variables,
data.domain.metas)))
varnames = [v.name for v in variables]
if self.conditions:
for attr, cond_type, cond_value in self.conditions:
if attr in varnames:
self.add_row(varnames.index(attr), cond_type, cond_value)
elif variables:
self.add_row()

self.update_info(data, self.data_in_variables, "In: ")
for attr, cond_type, cond_value in self.conditions:
attrs = [a.name for a in
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()

def conditions_changed(self):
Expand Down

0 comments on commit aaf594c

Please sign in to comment.