From: Ed Page Date: Wed, 14 Jul 2010 02:44:45 +0000 (-0500) Subject: Fixing issues with deleting random rows X-Git-Url: http://git.maemo.org/git/?a=commitdiff_plain;h=ca01490a05bea73cac54d5ad85148c920a6aa2cc;p=ejpi Fixing issues with deleting random rows --- diff --git a/src/qhistory.py b/src/qhistory.py index b5ed27b..af164b8 100644 --- a/src/qhistory.py +++ b/src/qhistory.py @@ -40,7 +40,7 @@ class QCalcHistory(history.AbstractHistory): self._historyView.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self._historyView.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) self._historyView.setHeaderHidden(True) - self._historyView.activated.connect(self._on_delete_row) + self._historyView.activated.connect(self._on_row_activated) viewHeader = self._historyView.header() viewHeader.setSortIndicatorShown(True) @@ -106,9 +106,10 @@ class QCalcHistory(history.AbstractHistory): self._rowCount = 0 @misc_utils.log_exception(_moduleLogger) - def _on_delete_row(self, index): + def _on_row_activated(self, index): if index.column() == self._CLOSE_COLUMN: self._historyStore.removeRow(index.row(), index.parent()) + self._rowCount -= 1 elif index.column() == self._RESULT_COLUMN: self._duplicate_row(index) else: