Skip to content

Commit

Permalink
Remove decorator method from class
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdekoning committed Aug 9, 2019
1 parent 5db553c commit 77fd320
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions activity_browser/app/ui/tables/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,6 @@ def get_max_height(self):
def sizeHint(self):
return QSize(self.width(), self.get_max_height())

@classmethod
def decorated_sync(cls, sync):
""" Syncs the data from the dataframe into the table view.
Uses either of the PandasModel classes depending if the class is
'drag-enabled'.
"""
@wraps(sync)
def wrapper(self, *args, **kwargs):
sync(self, *args, **kwargs)

self.model = self._select_model()
# See: http://doc.qt.io/qt-5/qsortfilterproxymodel.html#details
self.proxy_model = QSortFilterProxyModel()
self.proxy_model.setSourceModel(self.model)
self.proxy_model.setSortCaseSensitivity(Qt.CaseInsensitive)
self.setModel(self.proxy_model)
self._resize()

return wrapper

def _select_model(self) -> QAbstractTableModel:
""" Select which model to use for the proxy model.
"""
Expand Down

0 comments on commit 77fd320

Please sign in to comment.