From 49dabaab71491bf8b35122f6c8e60a061fe05549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Fri, 25 May 2018 20:55:05 +0200 Subject: [PATCH] Optimize seekChanged in FunctionsModel #498 --- src/widgets/FunctionsWidget.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/widgets/FunctionsWidget.cpp b/src/widgets/FunctionsWidget.cpp index fcb01817..8c3126f5 100644 --- a/src/widgets/FunctionsWidget.cpp +++ b/src/widgets/FunctionsWidget.cpp @@ -256,8 +256,14 @@ void FunctionModel::setNested(bool nested) void FunctionModel::seekChanged(RVA) { + int previousIndex = currentIndex; if (updateCurrentIndex()) { - emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1)); + if (previousIndex >= 0) { + emit dataChanged(index(previousIndex, 0), index(previousIndex, columnCount() - 1)); + } + if (currentIndex >= 0) { + emit dataChanged(index(currentIndex, 0), index(currentIndex, columnCount() - 1)); + } } }