From ca01490a05bea73cac54d5ad85148c920a6aa2cc Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 13 Jul 2010 21:44:45 -0500 Subject: [PATCH] Fixing issues with deleting random rows --- src/qhistory.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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: -- 1.7.9.5