From 3a357ea2d130ca88dc9ad2a37b75cd339983752e Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sat, 12 Sep 2020 13:35:57 +0200 Subject: [PATCH] Improve handling of lifecycle methods in retain-prior-search mode --- lookandfeel/contents/runcommand/RunCommand.qml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lookandfeel/contents/runcommand/RunCommand.qml b/lookandfeel/contents/runcommand/RunCommand.qml index 59ff44d87..6cdb2da06 100644 --- a/lookandfeel/contents/runcommand/RunCommand.qml +++ b/lookandfeel/contents/runcommand/RunCommand.qml @@ -43,10 +43,19 @@ ColumnLayout { if (runnerWindow.visible) { queryField.forceActiveFocus(); listView.currentIndex = -1 + if (runnerWindow.retainPriorSearch) { + // Hack: We want to retain the prior seach, but are in a different match session + // This way we ensure that the prior search gets executed as a new query + const priorSearch = root.query + queryField.text = "" + queryField.text = priorSearch + } + queryField.select(root.query.length, 0) } else { root.runner = "" if (runnerWindow.retainPriorSearch) { - queryField.select(root.query.length, 0) + // Same effect as setting empty string, but we want to retain this string for the next session + results.model.clear() } else { root.query = "" }