SUMMARY The prepare/teardown signal is emitted for each query and not for each match session. STEPS TO REPRODUCE 1. Connect to the signal in a runner: connect(this, &MyRunner::prepare, [=]() { qWarning() << "prepare"; }); 2. Install plugin, restart krunner 3. Type some letters OBSERVED RESULT The warning is displayed for each letter typed. EXPECTED RESULT The warning gets displayed when the first letter is typed. SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE Neon beta KDE Plasma Version: 5.18.80 KDE Frameworks Version: 5.70.0 Qt Version: 5.14.1 ADDITIONAL INFORMATION It works as expected with krunner 5.62.
Sounds like you could submit a patch. :)
But I have found the issue: I installed version 5.62 from source with the same issue, but then I reverted https://phabricator.kde.org/D22758 and installed it again and it works. I will do my best to write a patch :-).
https://phabricator.kde.org/D29050
Thanks!
Git commit 7c365354907d595d5e75458c4a3c4226ae40d3a4 by Alexander Lohnau. Committed on 27/05/2020 at 07:48. Pushed by alex into branch 'master'. KRunner fix prepare/teardown signals Summary: Because the teardown was requested and checked the prepped variable was set to false and consequently the prepare method gets called for the next character typed. The exact two lines get called in the `matchSessionComplete` method. The `matchSessionComplete` method gets called called in `RunnerResultsModel::clear` (milou repo). Test Plan: If you connect to the prepare/teardown slot, for example: ``` connect(this, &MyRunner::prepare, [=]() { qWarning() << "prepare"; });```` You see that they get triggered for each letter typed, after applying this patch they get only triggered when the match session is started/is over. Reviewers: meven, ngraham, broulik Reviewed By: meven Subscribers: davidedmundson, cfeck, kde-frameworks-devel Tags: #frameworks, #plasma Differential Revision: https://phabricator.kde.org/D29050 M +0 -3 src/runnermanager.cpp https://invent.kde.org/frameworks/krunner/commit/7c365354907d595d5e75458c4a3c4226ae40d3a4