[education/rkward] rkward/rbackend: Clarify
Thomas Friedrichsmeier
null at kde.org
Sun Aug 31 13:51:37 BST 2025
Git commit 58cf4f0699a6844b2ee3a670a66a9189dac6c938 by Thomas Friedrichsmeier.
Committed on 31/08/2025 at 12:50.
Pushed by tfry into branch 'master'.
Clarify
M +2 -1 rkward/rbackend/rkrbackend.cpp
https://invent.kde.org/education/rkward/-/commit/58cf4f0699a6844b2ee3a670a66a9189dac6c938
diff --git a/rkward/rbackend/rkrbackend.cpp b/rkward/rbackend/rkrbackend.cpp
index 6360af5d2..1a733c8b5 100644
--- a/rkward/rbackend/rkrbackend.cpp
+++ b/rkward/rbackend/rkrbackend.cpp
@@ -96,6 +96,7 @@ void RKRBackend::scheduleInterrupt() {
void RKRBackend::interruptCommand(int command_id) {
RK_TRACE(RBACKEND);
+ RK_ASSERT(command_id >= 0); // -1 would signify broken request
RK_DEBUG(RBACKEND, DL_DEBUG, "Received interrupt request for command id %d", command_id);
QMutexLocker lock(&all_current_commands_mutex);
@@ -106,7 +107,7 @@ void RKRBackend::interruptCommand(int command_id) {
* 2) when it is properly running in the backend -> this is the typical case, we worry about
* 2b) when it is properly running in the backend, but there is also an active sub-command, which we should allow to complete
* 3) after it finished running in the backend, but the frontend wasn't aware of that, yet TODO: buggy! */
- if ((command_id == -1) || (!all_current_commands.isEmpty() && (all_current_commands.last()->id == command_id))) {
+ if (!all_current_commands.isEmpty() && (all_current_commands.last()->id == command_id)) {
if (too_late_to_interrupt) {
RK_DEBUG(RBACKEND, DL_DEBUG, "too late to interrupt command id %d (repl uc status: %d)", command_id, repl_status.user_command_status);
} else {
More information about the rkward-tracker
mailing list