Skip to content

Commit 676f2d1

Browse files
committed
owselectcolumns: Remove no longer needed classes
... no longer needed since gh-2100 (also no longer do what they claim)
1 parent 91dd936 commit 676f2d1

File tree

1 file changed

+2
-35
lines changed

1 file changed

+2
-35
lines changed

Orange/widgets/data/owselectcolumns.py

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -93,39 +93,6 @@ def dropMimeData(self, mime, action, row, column, parent):
9393
return True
9494

9595

96-
class ClassVarListItemModel(VariablesListItemModel):
97-
def dropMimeData(self, mime, action, row, column, parent):
98-
""" Ensure only one variable can be dropped onto the view.
99-
"""
100-
vars = mime.property('_items')
101-
if vars is None:
102-
return False
103-
if action == Qt.IgnoreAction:
104-
return True
105-
return VariableListModel.dropMimeData(
106-
self, mime, action, row, column, parent)
107-
108-
109-
class ClassVariableItemView(VariablesListItemView):
110-
def __init__(self, parent=None, acceptedType=Orange.data.Variable):
111-
VariablesListItemView.__init__(self, parent, acceptedType)
112-
self.setDropIndicatorShown(False)
113-
114-
def acceptsDropEvent(self, event):
115-
"""
116-
Reimplemented
117-
118-
Ensure only one variable is in the model.
119-
"""
120-
accepts = super().acceptsDropEvent(event)
121-
mime = event.mimeData()
122-
vars = mime.property('_items')
123-
if vars is None:
124-
return False
125-
126-
return accepts
127-
128-
12996
class OWSelectAttributes(widget.OWWidget):
13097
name = "Select Columns"
13198
description = "Select columns from the data table and assign them to " \
@@ -189,8 +156,8 @@ def dropcompleted(action):
189156
layout.addWidget(box, 0, 2, 1, 1)
190157

191158
box = gui.vBox(self.controlArea, "Target Variable", addToLayout=False)
192-
self.class_attrs = ClassVarListItemModel(enable_dnd=True)
193-
self.class_attrs_view = ClassVariableItemView(
159+
self.class_attrs = VariablesListItemModel()
160+
self.class_attrs_view = VariablesListItemView(
194161
acceptedType=(Orange.data.DiscreteVariable,
195162
Orange.data.ContinuousVariable))
196163
self.class_attrs_view.setModel(self.class_attrs)

0 commit comments

Comments
 (0)