Allow to remove a selected process for the highlights
authorJulien Desfossez <julien.desfossez@efficios.com>
Tue, 24 Apr 2012 20:10:44 +0000 (16:10 -0400)
committerJulien Desfossez <julien.desfossez@efficios.com>
Tue, 24 Apr 2012 20:10:44 +0000 (16:10 -0400)
Signed-off-by: Julien Desfossez <julien.desfossez@efficios.com>
src/cursesdisplay.c

index b63fa9bce3dc32675aed27e5d6f6d1d27bae1785..49ec23ce6f8d72169abdc18af7ac33dd60902e61 100644 (file)
@@ -237,11 +237,21 @@ int process_selected(struct processtop *process)
 
 void update_selected_processes()
 {
+       int i;
+       struct processtop *stored_process;
+
        if (process_selected(selected_process)) {
-               g_ptr_array_remove(selected_processes, selected_process);
-               print_log("Process removed");
+               for (i = 0; i < selected_processes->len; i++) {
+                       stored_process = g_ptr_array_index(selected_processes, i);
+                       if (!stored_process)
+                               return;
+                       if (stored_process->tid == selected_process->tid)
+                               g_ptr_array_remove(selected_processes,
+                                               stored_process);
+                       print_log("Process removed");
+               }
        } else {
-               g_ptr_array_add(selected_processes, selected_process);
+                       g_ptr_array_add(selected_processes, selected_process);
                print_log("Process added");
        }
 }
This page took 0.024015 seconds and 4 git commands to generate.