From bd82f2cf4520dd5004e885865d36e01d0495d775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sun, 11 Nov 2018 12:10:32 +0100 Subject: [PATCH] Update Seek from ConsoleWidget only if it has changed --- src/widgets/ConsoleWidget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/widgets/ConsoleWidget.cpp b/src/widgets/ConsoleWidget.cpp index 3299fe90..841f0670 100644 --- a/src/widgets/ConsoleWidget.cpp +++ b/src/widgets/ConsoleWidget.cpp @@ -175,9 +175,10 @@ void ConsoleWidget::executeCommand(const QString &command) }); QString cmd_line = "
[" + RAddressString(Core()->getOffset()) + "]> " + command + "
"; + RVA oldOffset = Core()->getOffset(); commandTask = QSharedPointer(new CommandTask(command, CommandTask::ColorMode::MODE_256, true)); connect(commandTask.data(), &CommandTask::finished, this, [this, cmd_line, - command, originalLines] (const QString & result) { + command, originalLines, oldOffset] (const QString & result) { if (originalLines < ui->outputTextEdit->blockCount()) { removeLastLine(); @@ -188,7 +189,9 @@ void ConsoleWidget::executeCommand(const QString &command) commandTask = nullptr; ui->inputLineEdit->setEnabled(true); ui->inputLineEdit->setFocus(); - Core()->updateSeek(); + if (oldOffset != Core()->getOffset()) { + Core()->updateSeek(); + } }); connect(commandTask.data(), &CommandTask::finished, timer, &QTimer::stop);